Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Concat Distinct rows into a single string

$
0
0

Hi,

 

In my table I have rows like this

 

Table Name : Test

 

Name

-----------------------

sam

khan

sun

sam

 

My query

 

Select string_agg(Name,',') from Test

 

Output

 

sam,khan,sun,sam

 

But it is giving Duplicate values like sam comes twice.

 

Please help me to Eliminate duplicates while using string_agg function


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>