Query w/Group By




Who do management people always want it complex?

I need to run this query grouping by user Id and month:

SELECT userid||','||count(*)||','||sum(tranamt_n)
FROM ej1
WHERE effctvdate>=to_date('01/01/2007','mm/dd/yyyy')
and corrstat=' ' and tranamt_n>0
and officename='Linebarger'
group by userid, TO_CHAR(SYSDATE,'MM');

I have yet to figure this one out........


.