22,210
社区成员
发帖
与我相关
我的任务
分享
SELECT BILLID
,Flag = CASE WHEN COUNT(DISTINCT STOREID) = 1 THEN 1 ELSE 0 END
FROM S_SENDD
GROUP BY BILLID
sorry 括号错了
select (case whencount(distinct storeid)>1 then 0 else 1 end) from tb where billid='1001'
select case when(count(distinct storeid)>1 then 0 else 1 end) from tb where billid='1001'
不好意思啊,抄写错误
select case when count(distinct STOREID) >1 then 1 else 0 end from S_SENDD where BILLID = '1001'
select case when(count(*)-1)>0 then 1 else 0 end) from tb where billid='1001'