SUM UNION QUERY - PullRequest
       69

SUM UNION QUERY

0 голосов
/ 05 марта 2019

У меня есть запрос ниже для 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'

1 Ответ

0 голосов
/ 05 марта 2019
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')
...