Skip to content

Settings and activity

1 result found

  1. 1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    3 comments  ·  SQL Prompt  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    Vern Rabe commented  · 

    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;