Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

aggregation of distinct string in sql

Ram Kumar SwarnkarApr 6 2012 — edited Apr 6 2012
Hi,

I required one query that will display distinct record of string

Like if we have table dept with section id and employee

dept_id sec_id employee
1 1 Raj
1 1 shyam
1 1 arjun
1 2 Raj
2 3 vivek
2 3 kumar
2 4 vivek
2 4 kumar

I need output like this

dept_id employee unique name with aggregation of string
1 Raj,shyam,arjun
2 vievk,kumar

I can display all row as aggregate with LISTAGG but it is taking duplicate value as well.

Please help me.

Thank you in advance
Ram
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 4 2012
Added on Apr 6 2012
5 comments
1,491 views