Home » SQL & PL/SQL » SQL & PL/SQL » Complicated Query...Pls help
Complicated Query...Pls help [message #242756] Tue, 05 June 2007 00:37 Go to next message
nawshot
Messages: 12
Registered: May 2007
Junior Member
hi,

i need to write a query which displays my output in below fashion.

DEPTNO EMPNO
------ -----
10 7782,7839,7934
20 7566,7902,7876,7369,7788
30 7521,7844,7499,.....

the contents of the table are as shown below:

DEPTNO EMPNO
------ -----
10 7782
10 7839
10 7934
20 7566
20 7902
20 7876
20 7369
20 7788
30 7521
30 7844
30 7499

i am unable to work out this. Pls help me out.Sad

thanks in advance
naw.



Re: Complicated Query...Pls help [message #242758 is a reply to message #242756] Tue, 05 June 2007 00:44 Go to previous messageGo to next message
dhananjays
Messages: 2
Registered: February 2005
Junior Member
hi,

sqlsnippets go through this site and you will find many good examples for your problem and if you search this forum you will come across lots of examples for the same.



regards,
Re: Complicated Query...Pls help [message #242769 is a reply to message #242756] Tue, 05 June 2007 01:09 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Another way: search for "pivot" here, on AskTom, on Google...

Regards
Michel
Re: Complicated Query...Pls help [message #242794 is a reply to message #242769] Tue, 05 June 2007 02:20 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
I've seen this before. Wink

MHE
Previous Topic: How to find if a VARCHAR2 variable has contains a numeric data or not
Next Topic: How can one see what the previous or next row is without leaving the current record
Goto Forum:
  


Current Time: Thu Dec 05 07:55:19 CST 2024