The Report

  • + 10 comments

    I guess a more accurate one would be (I'm using Oracle):

    select (case when grade <8 THEN NULL ELSE name END) name, grade, marks
    from
    (select name, grade, marks
    from students, grades
    where marks between min_Mark and Max_Mark)
    order by grade desc, name, decode(name,NULL,marks);
    

    in this case, if two students have the same grade and name and their name is not null they won't be ordered by their marks.