I have one SQL query which i mentioned below, but i have used UNION ALL which is taking more time to execute. But i want some different approach to get the same details which will be more efficient. Please help me on this.
select creation_time, collected, errored
from batch_summary
where creation_time < (SYSDATE -1/24) and source_type in ('A','B','c')
group by creation_time, source_type
union all
select creation_time, collected, errored
from batch_summary
where creation_time < (SYSDATE -1/24) and source_type in ('d') and batch_id like '%PGW%'
group by creation_time, source_type
union all
select creation_time, collected, errored
from batch_summary
where creation_time < (SYSDATE -1/24) and source_type in ('E','F')
group by creation_time, source_type