Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Left Outer Join, group by, and date-based queries
Thanks, but none of the examples address doing a fake outer join on a
month. My half-assed result is:
select Months.dt, count(t2.month) total
from ( select to_char(to_date(level,'MM'),'YYYY Mon') AS dt from dual connect by level <= 12 ) Months,
(select to_char(trunc(user_date, 'MM'), 'YYYY Mon') Month
from userlog
where event = 'LOGIN'
) t2
where Months.dt = t2.month (+)
group by rollup( Months.dt )
however, I need to do this for month and year together, in other words, the above query filters out data only by month- not month/year. If anyone can point me in the right direction, that would be cool. my brain hurts.
Don Received on Mon Nov 28 2005 - 13:11:08 CST