Skip to content

Instantly share code, notes, and snippets.

@ledsun
Created December 5, 2011 06:30
Show Gist options
  • Select an option

  • Save ledsun/1432559 to your computer and use it in GitHub Desktop.

Select an option

Save ledsun/1432559 to your computer and use it in GitHub Desktop.
JOINなしで各行の値を文字結合
DECLARE @STR NVARCHAR(100)
SET @STR = ''
SELECT
@STR = @STR + STR1 + ' / '
FROM(
SELECT
'hoge' AS STR1
UNION
SELECT
'fuga' AS STR1
)A
SELECT @STR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment