Last active
May 10, 2022 15:19
-
-
Save NPS-ARCN-CAKN/93396938baa24c446c376038b94214b5 to your computer and use it in GitHub Desktop.
Sql: Select distinct values into comma separated list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @Packs AS NVARCHAR(MAX) | |
select @Packs = STUFF((SELECT DISTINCT ',' + QUOTENAME(LTRIM(RTRIM(Pack))) from basequeryTotalPupsByRegion FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)'),1,1,'') | |
select @Packs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment