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: Combine counted values from one column into one row

Re: Combine counted values from one column into one row

From: DA Morgan <damorgan_at_psoug.org>
Date: Thu, 17 May 2007 18:21:47 -0700
Message-ID: <1179451304.792417@bubbleator.drizzle.com>


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.org
Received on Thu May 17 2007 - 20:21:47 CDT

Original text of this message

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