用一条sql语句实现以下功能已知表中数据查询结果为80 68 55要求使用一条查询语句,使查询结果为优秀 及格 不及格

sosok 1年前 已收到1个回答 举报

skmn 春芽

共回答了13个问题采纳率:84.6% 举报

试试以下语句:
select
(case when 语文>=80 then '优秀' when 语文>=60 then '及格' else '不及格') as 语文,
(case when 数学>=80 then '优秀' when 数学>=60 then '及格' else '不及格') as 数学,
(case when 英语>=80 then '优秀' when 英语>=60 then '及格' else '不及格') as 英语
from 成绩表 where 班级='三年纪3班' and 姓名='张三'

1年前

9
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 16 q. 0.036 s. - webmaster@yulucn.com