sql语句:有一张表,里面有3个字段:英语.其中有3条记录分别表示语文70分,数学80分,英语58

问题描述:

sql语句:有一张表,里面有3个字段:英语.其中有3条记录分别表示语文70分,数学80分,英语58
我问的是数据库程序题
2个回答 分类:数学 2014-10-16

问题解答:

我来补答
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 student
 
 
展开全文阅读

补充回答:

SELECT IF((语文-80)>0,'优秀',if(语文-60)<0,'不及格','及格')) 语文, IF((数学-80)>0,'优秀',if(数学-60)<0,'不及格','及格')) 数学, IF((英语-80)>0,'优秀',if(英语-60)<0,'不及格','及格')) 英语 FROM table
网友(117.14.135.*) 2014-10-16

剩余:2000