SUM UNION QUERY

问题描述 投票:0回答:1

我有一个UNION ALL的以下查询。我只需要修改它就可以得出结果。

select count (*)
from BAU_DEAN_USER 
where checked_date >= date '2019-03-01' and checked_date < date '2019-03-05'

UNION ALL

select count (*)
from BAU_DEAN_USER_ARCHIVE 
where checked_date >= date '2019-03-01' and
      checked_date < date '2019-03-05'
sum union union-all
1个回答
0
投票
select count (*) from 
(select 'a' from
BAU_DEAN_USER where checked_date >= date '2019-03-01' and checked_date < date '2019-03-05'

UNION ALL

select 'a' from BAU_DEAN_USER_ARCHIVE where checked_date >= date '2019-03-01' and checked_date < date '2019-03-05')
© www.soinside.com 2019 - 2024. All rights reserved.