• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1061
  • Last Modified:

Convert row to comma separated column

Hi,

I have a table in oracle

Name    Task
------     ------
A           1
B           2
B           3
B           4
C           5
D           6
C           7

I want the output in following format

Name     Task
A            1
B            2,3,4
C            5,7
D            6

Can i get it in a single SQL without using any user function.

Vishal
0
vishalgoyal123
Asked:
vishalgoyal123
1 Solution
 
NopiusCommented:
It's better to place your question to DB->Oracle
0
 
nayernaguibCommented:
I think there is no aggregate function that would do this using a single SQL statement.
To obtain the desired output, you need to process data using a cursor and some temporary variables.

_______________

  Nayer Naguib
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now