Snowflake Vs MS-SQL - Part 31 - String Aggregate

     


String Aggregate

Sometimes we need to provide the column data into comma-separated values as below:
Suppose you have values like this in a table


And you want to return like this.



MS-SQL Server 

You can achieve this by using multiple ways. 


In the recent version of MS SQL Server, they came up with a new String Function STRING_AGG.



In Snowflakewe can use a similar function LISTAGG as STRING_AGG. 



For more details, you can refer to the following LISTAGG




Comments

Popular posts from this blog

Snowflake Vs MS-SQL - Series

Snowflake Vs MS-SQL - Part 79 - Adding a comment to the Column of a Table

Snowflake Vs MS-SQL - Part 75 - String Length and Trimmed Length