select categori,
jam1_2,
jam2_3
from
(
select categori,
count(case when dtm between (trunc(sysdate)+1/24) and (trunc(sysdate)+2/24) then 'A' else null end) as jam1_2,
count(case when dtm between (trunc(sysdate)+2/24) and (trunc(sysdate)+3/24) then 'B' else null end) as jam2_3
from test1
group by categori
);
Tidak ada komentar:
Posting Komentar