According to an error, using an aggregate of type Max requires a Group By clause if there are any non-aggregated columns in the selection list (in your case, you are trying to find MAX(Num) and then return the values associated in the ID column). In MS SQL Server, you can get what you want by organizing and restricting the returned rows:
SELECT TOP 1 ID, NUM FROM [table] ORDER BY NUM DESC;
In other RDBMS systems, LIMIT offers similar functionality.
Edit
If you need to return all rows with the same maximum, use WITH TIES qualification :
SELECT TOP 1 WITH TIES ID, NUM FROM [table] ORDER BY NUM DESC;
Stuartlc
source share