早教吧 育儿知识 作业答案 考试题库 百科 知识分享

有一张table-t表,里面有三个字段:英语,其中有三条记录分别表示语文70分,数学80分,英语58,请用一条sql语句查询出这三条记录并按以下条件显示出来:大于或等于80表优秀,大于等于60表及格,小

题目详情
有一张table-t表,里面有三个字段:英语,其中有三条记录分别表示语文70分,数学80分,英语58
,请用一条sql语句查询出这三条记录并按以下条件显示出来:
大于或等于80表优秀,大于等于60表及格,小于60表不及格显示格式:
及格 优秀 不及格
▼优质解答
答案和解析
select case when 语文>=80 then '优秀' when 语文>=60 then '及格' else '不及格' end 语文 ,
case when 数学>=80 then '优秀' when 数学>=60 then '及格' else '不及格' end 数学 ,
case when 英语>=80 then '优秀' when 英语>=60 then '及格' else '不及格' end 英语 from table_t