[Solved] Last 6 months aggregation
You can try with something like this: select TO_CHAR(CALLDATE,’yyyymm’),count(*) from yourTable –filter last n months (in this case 7) where CALLDATE> SYSDATE – INTERVAL ‘7’ MONTH –group by month group by TO_CHAR(CALLDATE,’yyyymm’); If you need zeros for months without a call: WITH MONTH_COUNTER AS ( SELECT LEVEL-1 AS ID FROM DUAL CONNECT BY LEVEL <= … Read more