Formatting CASE statements
Answered
I'm having trouble aligning END correctly when I'm formatting a CASE statement. It seems like END gets automatically indented.
What currently happens vs what I'm expecting:
SELECT
a,
b,
CASE
WHEN example IS NULL
THEN 'Small'
WHEN example = 'Small'
THEN 'Small Part Time'
WHEN example = 'Medium'
THEN 'Medium Practice'
END AS practice_size,
d
FROM example_table
SELECT
a,
b,
CASE
WHEN example IS NULL
THEN 'Small'
WHEN example = 'Small'
THEN 'Small Part Time'
WHEN example = 'Medium'
THEN 'Medium Practice'
END AS practice_size,
d
FROM example_table
Please sign in to leave a comment.
Hello,
Please open "Settings/Preferences | Editor | Code Style | SQL | General - Expressions - CASE clause" and set "Align END" to "Align with CASE".