← Customer Feedback for Redgate Settings and activity 1 result found Vertically align option for concatenated strings 2 votes Vote Vote Vote We're glad you're herePlease sign in to leave feedback Signed in as (Sign out) Close Close Vote We’ll send you updates on this idea 3 comments · SQL Prompt · Delete… · Admin → How important is this to you? Not at all You must login first! Important You must login first! Critical You must login first! We're glad you're herePlease sign in to leave feedback Signed in as (Sign out) Close Close An error occurred while saving the comment Vern Rabe commented · Jul 17, 2019 · Edit… · Delete… Okay, I've got the display formatting figured out... Here's what I get: 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 + CASE -----------------------------------------WHEN Col = 4 ---------------------------------------------THEN 'Col 4' -----------------------------------------ELSE '' -----------------------------------------END AS ConcatStr ---FROM #Test; But 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 ------+ CASE -----------WHEN Col = 4 ---------------THEN 'Col 4' -----------ELSE '' -----------END AS ConcatStr ---FROM #Test; Save Submitting...
Okay, I've got the display formatting figured out... Here's what I get:
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 + CASE
-----------------------------------------WHEN Col = 4
---------------------------------------------THEN 'Col 4'
-----------------------------------------ELSE ''
-----------------------------------------END AS ConcatStr
---FROM #Test;
But 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
------+ CASE
-----------WHEN Col = 4
---------------THEN 'Col 4'
-----------ELSE ''
-----------END AS ConcatStr
---FROM #Test;