sql 中的case与group by
= 60 then '及格' else '不及格' end "}}}'>

1个回答

  • 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 表 select bdate,count(case bwon when '胜' then bwon end),count(case bwon when '负' then bwon end) from 表 group by bdate