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 -> Computed value for a column header

Computed value for a column header

From: Stanley Shapiro <stanley.shapiro_at_wcom.com>
Date: 19 Dec 2001 14:57:24 -0800
Message-ID: <326e0677.0112191457.74580e12@posting.google.com>


I have the following select within a stored procedure:

 select

  sum(decode(week_date,weekof(2),amount,0)),
  sum(decode(week_date,weekof(3),amount,0)),
  sum(decode(week_date,weekof(4),amount,0)),
  sum(decode(week_date,weekof(5),amount,0))
 from ....

which totals 'amount' for four weeks, putting the totals in the correct column according to pre-calculated week-beginning dates. I would like to use the 'weekof(.)' value as a column header:

      sum(decode(week_date,weekof(2),amount,0)) weekof(2),

 but the compiler appears to reject anything other than fixed text as a column header.

Any workaround ?

Thanks. Received on Wed Dec 19 2001 - 16:57:24 CST

Original text of this message

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