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
subbu_tce
Messages: 98
Registered: July 2007
Location: pune
Member
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
JRowbottom
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: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
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.

/forum/fa/1637/0/
Michel


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


Current Time: Sun Feb 09 09:56:03 CST 2025