Home » SQL & PL/SQL » SQL & PL/SQL » Need SQL Query (Oralce 10g R2)
Need SQL Query [message #318928] Thu, 08 May 2008 08:05 Go to next message
babuknb
Messages: 1734
Registered: December 2005
Location: NJ
Senior Member

Hi,

SQL> select * from tst
  2  /

         A          B
---------- ----------
         1         11
         1         11
         1         11


I need o/p like

         A          B
---------- ----------
         1         11,11,11


or

         A          B
---------- ----------
         1         11
                    11
                    11


Please guide me how to write SQL Query.

Babu




Re: Need SQL Query [message #318929 is a reply to message #318928] Thu, 08 May 2008 08:07 Go to previous messageGo to next message
joy_division
Messages: 4640
Registered: February 2005
Location: East Coast USA
Senior Member
Search for PIVOT or BREAK.
Re: Need SQL Query [message #319297 is a reply to message #318928] Fri, 09 May 2008 12:19 Go to previous message
drewsmith70
Messages: 22
Registered: April 2008
Location: New Hampshire
Junior Member
You might consider writing an aggregate function that uses a cursor, and call the function for each instance of A.

Look here for implementation.
Previous Topic: conversion of row data to separate columns
Next Topic: Dont know how to write it...
Goto Forum:
  


Current Time: Sat Dec 03 05:48:38 CST 2016

Total time taken to generate the page: 0.09710 seconds