Home » SQL & PL/SQL » SQL & PL/SQL » Pivot query (merged)
Pivot query (merged) [message #300116] Thu, 14 February 2008 05:05 Go to next message
spmano1983
Messages: 269
Registered: September 2007
Senior Member
Hi,

I need a requirement like this

Quote:


DEPTNO JOB SAL
------- --------- ---------
10 CLERK 1300
10 MANAGER 2450
10 PRESIDENT 5000
20 ANALYST 3000
20 ANALYST 3000
20 ANALYST 3500
20 CLERK 800
20 CLERK 1100
20 MANAGER 2975
30 CLERK 950
30 MANAGER 2850
30 SALESMAN 1600
30 SALESMAN 1500
30 SALESMAN 1500

Output should be...

DEPTNO JOB SAL1 SAL2 SAL3
-------- --------- --------- --------- ---------
10 CLERK 1300
10 MANAGER 2450
10 PRESIDENT 5000
20 ANALYST 3000 3000 3500
20 CLERK 800 1100
20 MANAGER 2975
30 CLERK 950
30 MANAGER 2850
30 SALESMAN 1600 1500 1500




Thanks

Mano
Re: Query [message #300120 is a reply to message #300116] Thu, 14 February 2008 05:08 Go to previous messageGo to next message
ramanajv1968
Messages: 168
Registered: December 2005
Location: HYDERABAD
Senior Member
Search the forum, answered several times in this forum.
Not exactly the same but it matches your requirements.
Re: Pivot query (merged) [message #300351 is a reply to message #300116] Fri, 15 February 2008 02:50 Go to previous messageGo to next message
spmano1983
Messages: 269
Registered: September 2007
Senior Member
Friends,

Atleast post the URL Link.. other wise subject line to search.

Regards

Mano
Re: Pivot query (merged) [message #300353 is a reply to message #300351] Fri, 15 February 2008 03:04 Go to previous message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
other wise subject line to search

Maybe the title of this topic? Just an idea.

Regards
Michel

[Updated on: Fri, 15 February 2008 03:04]

Report message to a moderator

Previous Topic: numeric overflow error
Next Topic: difference between @ and @@
Goto Forum:
  


Current Time: Fri Dec 09 01:45:25 CST 2016

Total time taken to generate the page: 0.22885 seconds