
Get unique values using STRING_AGG in SQL Server
May 29, 2018 · Get unique values using STRING_AGG in SQL Server Asked 7 years, 6 months ago Modified 9 months ago Viewed 211k times
sql - How to sort the aggregate values from STRING_AGG () IN …
This question is not about SQLServer's version of STRING_AGG() with ORDER BY. SQL Server pages: How to get strings comma separated in ascending order with SQL Server's STRING_AGG () and …
aggregate functions - Can we use SQL Server STRING_AGG () in queries ...
Mar 29, 2023 · 2 As you have seen, STRING_AGG is not allowed when using any kind of grouping set in a GROUP BY. You can hack it as follows sql
sql - Concatenate text from multiple rows into a single text string ...
SQL Server 2017+ and SQL Azure: STRING_AGG Starting with the next version of SQL Server, we can finally concatenate across rows without having to resort to any variable or XML witchery. …
How to ORDER BY with SQL Server's STRING_AGG ()
Mar 21, 2020 · I have this query (I am using SQL Server 2019) and is working fine (combining Dates and Notes into one column). However, the result I am looking for is to have the latest date show up first. …
sql - STRING_AGG aggregation result exceeded the limit of 8000 bytes ...
Sep 19, 2022 · select c.id , c.bereichsname , STRING_AGG(j.oberbereich,',') oberBereiches from stellenangebote_archiv as j join bereiche as c on j.bereich_id = c.id group by c.id, c.bereichsname …
How to use STRING_AGG function inside another STRING_AGG …
Sep 25, 2024 · How to use STRING_AGG function inside another STRING_AGG function in SQL Server Asked 1 year, 2 months ago Modified 1 year, 2 months ago Viewed 672 times
sql - Optimal way to concatenate/aggregate strings - Stack Overflow
They have implimented STRING_AGG () in Azure SQL Database as well. That should provide the exact functionality originally requested in this post with native and built in support. @hrobky mentioned this …
String_agg for SQL Server before 2017 - Stack Overflow
Mar 19, 2018 · Can anyone help me make this query work for SQL Server 2014? This is working on PostgreSQL and probably on SQL Server 2017. On Oracle it is listagg instead of string_agg. Here is …
How to write the T-SQL STRING_AGG function - Stack Overflow
Jul 14, 2018 · The issue is, because SQL Server 2014 doesn't have access to STRING_AGG, the stored procedures we wrote for our Azure SQL database won't work locally. The function needs to …