Re: oracle row months in columns

From: joel garry <joel-garry_at_home.com>
Date: Mon, 27 Dec 2010 17:39:21 -0800 (PST)
Message-ID: <d3398234-e4ab-4d85-aa9c-14419e7e8821_at_e16g2000pri.googlegroups.com>



On Dec 27, 3:27 pm, master44 <trp..._at_gmail.com> wrote:
> I have a query that returns results like this:
>
> Month           Agent     Cases Worked
> ----------------   -----------   -----------------------
> Sept              Tom            5
> Sept              John           12
> Sept              Megan         6
> Oct               Tom             2
> Oct               John            7
> Oct               Megan         8
> Nov               Tom            11
> Nov               John           13
> Nov               Megan        16
>
> I am looking to plot this data as a multiple line graph, and would
> like to change the output to look something like this, but am not
> having any luck:
>
> Agent     Sept     Oct     Nov
> ----------    -------    -------   -------
> Tom          5          2        11
> John         12         7        13
> Megan      6           8        16
>
> This is just a sample output, and the number of months returned or
> number of agents returned is variable, so for example above we are
> showing 3 months and 3 agents, but the result set could have 12 months
> and 5 agents as an example so the query would need to be dynamic to
> accomidate.
>
> Thanks

http://lmgtfy.com/?q=pivot+query+site%3Aasktom.oracle.com

jg

--
_at_home.com is bogus.
http://www.computerweekly.com/Articles/2010/12/27/244642/CW+-Analyst39s-take-The-benefits-of-third-party-SAP-and-Oracle.htm
hmmmmmm....
Received on Mon Dec 27 2010 - 19:39:21 CST

Original text of this message