Created
December 5, 2011 06:30
-
-
Save ledsun/1432559 to your computer and use it in GitHub Desktop.
JOINなしで各行の値を文字結合
This file contains hidden or 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 @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