对数据字段,根据结果进行别名
SQLServer
SELECT [name], case when cj.chinese >80 then '优秀' when cj.chinese >=60 then '及格' else '不及格' end as 语文, case when cj.english >80 then '优秀' when cj.english >=60 then '及格' else '不及格' end as 英语 FROM [Demo].[dbo].[CJ] as cj
其中,,case 和 end 需要成对出现,,缺一不可,,,不需要括号