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

Home -> Community -> Usenet -> c.d.o.server -> Re: newbie: A Quickie for some guru out there.

Re: newbie: A Quickie for some guru out there.

From: Candido Dessanti <termy_at_blunet.it>
Date: Tue, 17 Sep 2002 14:16:22 +0200
Message-ID: <3D871D16.6000607@blunet.it>

> What are you thinking?

I am thinking a solution like that

select to_char(add_month(
to_date('startdate','MON-YYYY'),rownum),'MON-YYYY',0 from all_tab_columns (or any table of your choice...better if it contains hundreds of rows instead millions :) where rownum =< (the range of months you would like to have e.g. 12 for a year)

this would generate a virtual table without having a physical table so

> SELECT
> TO_CHAR( trunc( workdate, 'month' ), 'MON-YYYY' ) AS Month,
> ROUND( SUM( requesthours ))
> FROM

        (select to_char(add_month(
to_date('JAN-2001','MON-YYYY'),rownum),

           'MON-YYYY') workdate,0 requesthours
          from any_tab

where rownum =< 12)
> GROUP BY
> trunc( workdate, 'month' );

does it works?

ciao Received on Tue Sep 17 2002 - 07:16:22 CDT

Original text of this message

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