Home » SQL & PL/SQL » SQL & PL/SQL » Need a query
Need a query [message #251746] Mon, 16 July 2007 08:39 Go to next message
Messages: 98
Registered: July 2007
Location: pune
Am having a table called abc which contains 2 columns called x number, y char(1) with data as follows

x y
1 b
1 a
1 l
2 b
2 a
2 j
2 a
2 j

I need a output as

x y

1 bal
2 bajaj
Re: Need a query [message #251749 is a reply to message #251746] Mon, 16 July 2007 09:09 Go to previous messageGo to next message
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
You will need a 3rd column in the table that specifies which order the rows are to be returned in.
Other than that, do a search for 'Pivot'
Re: Need a query [message #251755 is a reply to message #251746] Mon, 16 July 2007 10:00 Go to previous message
Michel Cadot
Messages: 65090
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I have a dream.
I have a dream that one day there will be a couple of days without any pivot question.


Previous Topic: Join tables from two databases
Next Topic: PLS-00201 identifier must be declared
Goto Forum:

Current Time: Fri Jul 28 12:26:23 CDT 2017

Total time taken to generate the page: 0.12831 seconds