select
eff_date,
sum(number_of_items)
from
(select
to_char(effective_report_date,'mmyyyy') as eff_date,
count(*) number_of_items
from dm1
where to_char(effective_report_date,'mmyyyy') = '082004'
group by to_char(effective_report_date,'mmyyyy')
union all
select
to_char(effective_report_date,'mmyyyy') as eff_date,
sum( number_of_items)
from dm2
where to_char(effective_report_date,'mmyyyy') = '082004'
group by to_char(effective_report_date,'mmyyyy')
)
group by eff_date
Tags: Oracle, SQL
This entry was posted
on Tuesday, 1. March 2005 at 10:35 and is filed under Oracle.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback (Guckstu hier) from your own site.