SELECT t1.* FROM Ppgval t1 WHERE EXISTS ( SELECT * FROM Ppgval t2 WHERE t1.node = t2.node And t1.rollno = t2.rollno AND t1.gvald = MAX(t2.gvald))to SQL and got back the response:
Server: Msg 147, Level 16, State 1, Line 1 An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING clause or a select list, and the column being aggregated is an outer reference.It seems to me that both these options only work with a GROUP BY clause.