Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Computed value for a column header
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
![]() |
![]() |