[Solved] SQL Server group by clause and display all columns [closed]


SELECT 
    t1.ID
    ,t1.NAME
    ,t1.Grade
    ,t1.Marks
FROM t1
INNER JOIN (
    SELECT Grade
        ,max(Marks) AS highest_marks
    FROM t1
    GROUP BY Grade
    ) AS TEMP ON t1.Marks = TEMP.highest_marks
    AND t1.Grade = TEMP.Grade

1

solved SQL Server group by clause and display all columns [closed]