Comments
6 comments
-
Hi a.higgins,
So just to confirm and/or clarify what you actually expect would be the following:SELECT CASE WHEN 1 = 1 THEN 1 END AS x ,1 AS y SELECT 0 AS w ,CASE WHEN 1 = 1 THEN 1 END AS x ,1 AS y
Is that correct?
Kind regards,
Alex -
Yes, that would be correct: I would expect the "place first item on new line" setting to supersede the "Collapse CASE statements" setting.
-
Hi a.higgins,
Righto that makes sense. I've escalated this to the developers and will let you know what they say!
Kind regards,
Alex -
Hi a.higgins,
Thanks for sending this in, I'm looking at it now!
And you're quite right - they are definitely expressions. I'll change the text.
Best regards,
David -
Hi a.higgins,
I've got a fix for it, so this will be in the next beta release.
Best regards,
David -
Confirmed, this now works as expected (and thanks for calling it a CASE expression, too!)
Add comment
Please sign in to leave a comment.
When I have "Place first item on new line" set to Always and "Collapse CASE statements" unchecked, my code looks like the following:
When I check "Collapse CASE statements", it turns into this:
Notice that the query with the CASE expression first goes back and forth between respecting the First Line option and ignoring it.
Closing nitpick: technically it's a CASE expression, not a CASE statement...