Created
May 29, 2013 09:51
-
-
Save bojanbjelic/5669203 to your computer and use it in GitHub Desktop.
sql server csv
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
SELECT distinct | |
SUBSTRING((SELECT ',' + CAST(countryId as VARCHAR) | |
FROM countries_regions where countries_regions.regionId = regions.id | |
FOR XML PATH('')), 2, 20000) AS CSV, regions.id | |
FROM countries_regions | |
inner join regions ON countries_regions.regionId = regions.id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment