当前位置: 代码迷 >> SQL >> sql 某列中间相同的类型累加
  详细解决方案

sql 某列中间相同的类型累加

热度:23   发布时间:2016-05-05 12:20:29.0
sql 某列当中相同的类型累加
select Sum(case when buy_status =1 then 1 else 0 end) '订购',			 Sum(case when buy_status =2 then 1 else 0 end) '退订',Sum(case when buy_status =6 then 1 else 0 end) '续订'	from business_recordGROUP BY DATE(create_time)


  相关解决方案