帆软用户bdlBLqiomK(提问者)select name,
(case
when English>=80 and English<=100 then \'A\'
when English>=70 and English<80 then \'B\'
when English>=60 and English<70 then \'C\'
when English>=0 and English<60 then \'D\'
end) English,
(case
when French>=80 and French<=100 then \'A\'
when French>=70 and French<80 then \'B\'
when French>=60 and French<70 then \'C\'
when French>=0 and French<60 then \'D\'
end) French
from
(select name,(case course when \'English\' then grade end)as English,(case course when \'French\' then grade end)as French from stscore)
danhua 回复 帆软用户bdlBLqiomK(提问者)select NAME,
(CASE WHEN English >= 80 AND English <= 100 THEN \'A\'
WHEN English >= 70 AND English < 80 THEN \'B\'
WHEN English >= 60 AND English < 70 THEN \'C\'
WHEN English >= 0 AND English < 60 THEN \'D\'
END) ENGLISH,
(CASE WHEN French >= 80 AND French <= 100 THEN \'A\'
WHEN French >= 70 AND French < 80 THEN \'B\'
WHEN French >= 60 AND French < 70 THEN \'C\'
WHEN French >= 0 AND French < 60 THEN \'D\'
END) FRENCH
from (select NAME,COURSE,GRADE from STSCORE)pivot (MAX(GRADE) for COURSE in (\'English\' as English,\'French\' AS French));