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: pivot/transform in Oracle

Re: pivot/transform in Oracle

From: <oaksong_at_hotmail.com>
Date: 1 Feb 2006 08:13:15 -0800
Message-ID: <1138810395.112141.118230@o13g2000cwo.googlegroups.com>


And the answer was..........

I needed to include the NAME, as well as the other fields.

I was then able to perform a GROUP BY against the second result.

The final code looked like:

select Desc,Time,NAME,

     max(decode....etc.) sunday
     etc

from
(select basic from ...)
)
Group by desc,time, NAME

That eliminated the blanks, but forced the retention of all the names. (In case anyone should come across this and need a resolution.) And I simply ignore the NAME field for the reports.

oaksong_at_hotmail.com wrote:
> Well...it was worth a try. :)
>
> The actual results without MAX are, for instance with Watch 1, 5 rows
> with D'Arcy in 4 of them and Jame Robin, one Name for each day of the
> week in which the individual is listed in the basic output. So it looks
> a bit like a sparse checker board.
>
> And I misphrased my comment after the second grid shown above where the
> sentance begins 'Notice that I get', it should have said 'Notice that I
> should like to get'.
>
> As I stated above, using MAX, I only get one record for Watch 1 (or any
> of the Watchs) since MAX takes only the first NAME encountered and
> ignores the rest.
>
> Thanks for following this.
Received on Wed Feb 01 2006 - 10:13:15 CST

Original text of this message

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