How to get the name for a maximum or minimum value from a table

May I know what’s the problem I encountered?