sqlserver case用法
发布时间:2020-12-12 15:00:14 所属栏目:MsSql教程 来源:网络整理
导读:select ?????? paypalCount=sum(case when Transype_tinyint=0 then 1 else 0 end)? ----then 1表示符合条件加1 ??????donationCount=sum(case when Transype_tinyint=1 then 1 else 0 end)----then 1表示符合条件加1 ??????communityCount=sum(case when Tr
select ?????? paypalCount=sum(case when Transype_tinyint=0 then 1 else 0 end)? ----then 1表示符合条件加1 ??????donationCount=sum(case when Transype_tinyint=1 then 1 else 0 end)----then 1表示符合条件加1 ??????communityCount=sum(case when Transype_tinyint=1 then 1 else 0 end)----then 1表示符合条件加1 ????? from 表名 ????? order by 字段名 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |