Home » SQL & PL/SQL » SQL & PL/SQL » Top values in same line
Top values in same line [message #198326] Mon, 16 October 2006 10:55 Go to next message
renafi
Messages: 42
Registered: October 2006
Member
How can i get the three top values of a query result in the same line?


eg:

Field X | Field Y

A | 50

B | 30

A | 20

A | 45


Result of A:

Field | first value | second value | third value

A | 50 | 45 | 20


Thanks.

[Updated on: Mon, 16 October 2006 10:56]

Report message to a moderator

Re: Top values in same line [message #198343 is a reply to message #198326] Mon, 16 October 2006 13:16 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Search here for 'pivot'. This question is usually asked at least once a day.
Re: Top values in same line [message #198392 is a reply to message #198343] Tue, 17 October 2006 00:48 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Or search for concat_all or stragg. There are plenty of examples on the board.

http://www.orafaq.com/forum/fa/448/0/

This one's closed.

MHE
Previous Topic: Viewing sql for a VIEW
Next Topic: formating the query output
Goto Forum:
  


Current Time: Thu Dec 08 15:58:02 CST 2016

Total time taken to generate the page: 0.09276 seconds