Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Left Outer Join, group by, and date-based queries

Re: Left Outer Join, group by, and date-based queries

From: <bbcrock_at_gmail.com>
Date: 28 Nov 2005 11:11:08 -0800
Message-ID: <1133205068.338516.122240@g47g2000cwa.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US