Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: About functionality like pivot-table using SQL
Sameer wrote:
> Dear All.
> Please access the link of a documnet:
> http://docs.google.com/View?docid=dhntd3vh_0gmwgmq
> A 'query-output' is given.
> I have pasted this output in Excel and using it's Pivot table feature
> obtained an output as 'Expected-Output' given.
> How can I achieve this using SQL?
> If you suppose that it a RTFM question just ignore this.
> I am ready to work on this problem but any guidelines are most welcome.
> -Sameer
You will need to use GROUP BY and DECODE to obtain the desired results.
Something to experiement with:
SELECT
MODULE,
DECODE(UPPER(AFFECTEDAREATYPE),'INTELLIVIEW REPORT',ISSUE_COUNT,0)
"INTELLIVIEW REPORT",
DECODE(UPPER(AFFECTEDAREATYPE),'MASTER',ISSUE_COUNT,0) "MASTER", DECODE(UPPER(AFFECTEDAREATYPE),'REPORT',ISSUE_COUNT,0) "REPORT", DECODE(UPPER(AFFECTEDAREATYPE),'TRANSACTION',ISSUE_COUNT,0)"TRANSACTION",
Charles Hooper
PC Support Specialist
K&M Machine-Fabricating, Inc.
Received on Mon Oct 16 2006 - 06:37:28 CDT