Well, the comment format is not at all what I submitted. I'll try again:
SELECT CASE
WHEN COL = 1
THEN 'COL 1'
ELSE ''
END + CASE
WHEN COL = 2
THEN 'COL 2'
ELSE ''
END + CASE
WHEN COL = 3
THEN 'COL 3'
ELSE ''
END AS ConcatStr
FROM #Test;
What I'd like to get is:
SELECT CASE
WHEN COL = 1
THEN 'COL 1'
ELSE ''
END
+ CASE
WHEN COL = 2
THEN 'COL 2'
ELSE ''
END
+ CASE
WHEN COL = 3
THEN 'COL 3'
ELSE ''
END AS ConcatStr
FROM #Test
Well, the comment format is not at all what I submitted. I'll try again:
SELECT CASE
WHEN COL = 1
THEN 'COL 1'
ELSE ''
END + CASE
WHEN COL = 2
THEN 'COL 2'
ELSE ''
END + CASE
WHEN COL = 3
THEN 'COL 3'
ELSE ''
END AS ConcatStr
FROM #Test;
What I'd like to get is:
SELECT CASE
WHEN COL = 1
THEN 'COL 1'
ELSE ''
END
+ CASE
WHEN COL = 2
THEN 'COL 2'
ELSE ''
END
+ CASE
WHEN COL = 3
THEN 'COL 3'
ELSE ''
END AS ConcatStr
FROM #Test