Header Ads Widget

Responsive Advertisement

Ticker

6/recent/ticker-posts

How to fetch data from SQL with comma separated

To fetch the data from SQL and dispaly in comma seperated , we need use one SQL function for this. 

SQL Function: string_agg

This function is useful to achive this functionality. 

How to use:

Select string_agg(column_name,',') from DEPT

Output: 1,2,3,4 - data will display like this. 

Note: This SQL function is availbale in higher version. 

Post a Comment

0 Comments