select name, score, case score/20::integer when 4 then 'A' when 3 then 'B' else 'C' end as rank from student order by gnum, cnum, num limit 10 ;