4,816
社区成员
发帖
与我相关
我的任务
分享
Select (sum(a.count1)-sum(a.count2)) as countx
from
(
select count(*) as count1,0 as count2 from table1 where etl_date=enddate
union all
select 0 as count1,count(*) as count2 from table1 where etl_date=startdate-1
) as a
select [count] from table where etl_date=enddate --count2
select [count] from table where etl_date=startdate-1 --count1