首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

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

2013-03-25 
sql 某列当中相同的类型累加select Sum(case when buy_status 1 then 1 else 0 end) 订购, Sum(case wh

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)


热点排行