How do I get this query into Discoverer Plus

Hi all,
I have the following query:
SELECT h.hrs, NVL(Quantity, 0) Quantity
FROM (SELECT TRIM(to_char(LEVEL - 1, '00')) hrs
FROM dual
CONNECT BY LEVEL < 25) h
LEFT JOIN (SELECT TO_CHAR(event_date, 'HH24') AS during_hour,
COUNT(*) Quantity
FROM user_activity u
WHERE event_date BETWEEN
to_date('15-JUN-2010 14:00:00', 'DD-MON-YYYY HH24:MI:SS') AND
to_date('16-JUN-2010 13:59:59', 'DD-MON-YYYY HH24:MI:SS')
AND event = 'user.login'
GROUP BY TO_CHAR(event_date, 'HH24')) t
ON (h.hrs = t.during_hour)
ORDER BY h.hrs;
Which produces the number of actions performed (from an event table, user_activity) grouped by the hour of the day they occurred (including displaying hours that have zero records - this bit is important!). I want to be able to put this into Discoverer plus as a worksheet, but I'm having trouble trying to figure out how.
I was able to create a custom folder in Administrator for the select from DUAL, but I cannot link it to the user_activity table because there's no relationship between to two tables to create a join.
The user_activity table is:
USER_ID - VARCHAR2(8 CHAR)
EVENT_DATE - DATE
EVENT - VARCHAR2(100 CHAR)
The custom folder is this part of the SQL:
SELECT TRIM(to_char(LEVEL - 1, '00')) hrs FROM dual CONNECT BY LEVEL < 25
Any suggestions would be greatly appreciated.
Thanks.
Edited by: Cyntech on Aug 12, 2010 10:41 AM

KK wrote:
hi,
In the custom folder we can join tables,but the thing is you said ther is no join between them.
I would suggest you to built this query into a view and use this view in the DUAL table by writing inline query or subquery what ever way.
This is the only possibility i can think off.
Hope it helps you.
By,
KKHi,
Thanks for the reply, though I'm not sure that I understand what you are suggesting.
Which query would you turn into a view? If you are referring to the select from dual, then how would the view be any different from the custom folder? You still would not be able to join it to user_activity as there are no common columns.
Edited by: Cyntech on Aug 12, 2010 2:49 PM

Similar Messages

Maybe you are looking for

  • IPhone 5 pixelated images in various apps problem- occurred within last 2 months and must be a result of apple network driver update

    iPhone 5 pixelated images in various apps problem- occurred within last 2 months and must be a result of apple network driver update What's the fix? Tried reset, restart, reboot, reopen of apps same problem

  • Personal tags in Retention Policy only working in OWA, not Outlook 2010 client

    Version: Exchange 2010 SP2 Client: Office Professional Plus 2010 SP1 As we don't want to enforce retention or archiving policies, but still give users the options to add tags to folders I set up new Retention Policy with the following tags only: -Per

  • Single Node RAC on 11.2.0.3

    Hi All, i have implemented Rac One node with two machine(dbtest01,dbtest02) in 11.2.0.3 Redhat 5.3 one for online another one for offline. i have created TAF also. dbtest01 is online and created one query DECLARE i number(36):=1; begin while(i<100000

  • PO printing through ME91F

    Hi Experts, I am trying to print PO's through transaction ME91F and the problem is for the first PO 1 spool is created and for the second PO 2 spools are created and so on.... Actually our configured custom program is not getting triggered and we hav

  • Photoshop delay while opening images

    Hi. Just one quick qestions to all CS5 users here. If I open up an image (small or large does not matter) it pops up into photoshop CS5, but i have a delay of 3-5 seconds before i am able to move the image window, use a brush or any other tool on it.