The Report

  • + 1 comment

    SELECT CASE WHEN G.Grade > 7 THEN S.Name ELSE 'NULL' END, G.Grade, S.Marks FROM STUDENTS S LEFT JOIN Grades G ON S.Marks BETWEEN G.Min_Mark AND G.Max_Mark ORDER BY G.Grade DESC, CASE WHEN G.Grade > 7 THEN S.Name ELSE S.Marks END ASC