Home » SQL & PL/SQL » SQL & PL/SQL » Converting duplicate data to one row
Converting duplicate data to one row [message #386389] Sat, 14 February 2009 05:12 Go to next message
anishki81
Messages: 1
Registered: February 2009
Junior Member
I have got a table with me hoaving this sample data

ID CODE DESCRIPTION
--- ---- -----------
1 123 NOREPLY
1 345 INCORRECT
1 678 BADCUSTOMER
1 911 INVALIDREASON

I need the result as follows

ID DESCRIPTION1 DESCRIPTION2 DESCRIPTION3 DESCRIPTION4
--- ----------- ----------- ----------- -----------
1 NOREPLY INCORRECT BADCUSTOMER INVALIDREASON


Can we do this using a single query
Re: Converting duplicate data to one row [message #386393 is a reply to message #386389] Sat, 14 February 2009 07:02 Go to previous messageGo to next message
trivendra
Messages: 208
Registered: October 2007
Location: Noida, India
Senior Member
Look for PIVOT.
Re: Converting duplicate data to one row [message #386401 is a reply to message #386389] Sat, 14 February 2009 09:11 Go to previous messageGo to next message
Michel Cadot
Messages: 64117
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
And as stated by the red ball: read OraFAQ Forum Guide BEFORE posting.

Regards
Michel

[Updated on: Sun, 15 February 2009 01:33]

Report message to a moderator

Re: Converting duplicate data to one row [message #386446 is a reply to message #386401] Sun, 15 February 2009 01:24 Go to previous message
seyed456
Messages: 220
Registered: May 2008
Location: south india .
Senior Member

goto this link ...that will definitely help you



http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:766825833740
Previous Topic: Replacing a Null column value with the value of the above record
Next Topic: how to find TOP 5 employee record
Goto Forum:
  


Current Time: Tue Dec 06 02:47:59 CST 2016

Total time taken to generate the page: 0.08185 seconds