Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Combine counted values from one column into one row
kasare34_at_gmail.com wrote:
> I have a query where I can have a count(*) counting certain values of
> progress and outputting like this:
>
> Mike Approved 3
> Mike Not Started 5
> John Approved 2
> John On Hold 5
>
> Does anyone know how I can display as:
>
> Approved Not Started On Hold
> Mike 3 5 0
> John 2 0 5
>
>
> Have been trying things crazily all day, please help! (Or point me in
> the correct direction if possible) Thanks in advance
>
> KA
You need to cross-tabulate, or pivot, using DECODE or CASE.
Demos in Morgan's Library at www.psoug.org under both functions.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Thu May 17 2007 - 20:21:47 CDT