I have some table, which I want count column that column have 2 category, the explain table like this:
I have query with union like this:
select CLASS, BRANCH, COUNT(STATUS) as STATUS
from dwh.Table a
where STATUS = 'INCLUDE'
group by CLASS, BRANCH, STATUS
order by CLASS
union
select CLASS, BRANCH, COUNT(STATUS) as STATUS
from dwh.Table a
where STATUS = 'NOT INCLUDE'
group by CLASS, BRANCH, STATUS
order by CLASS
but I have got some error.