sql-formatter
sql-formatter copied to clipboard
CASE WHEN dont have a line break
having something like this:
CASE WHEN ... WHEN ... WHEN ... THEN ...
is not creating a line break after each WHEN command. right now its beiing displayed like this:
CASE WHEN ... WHEN ... WHEN ... THEN ...
With a lot of CASEs, this is getting difficult.
To be more precise, syntax is a bit different:
https://www.techonthenet.com/oracle/functions/case.php
https://www.techonthenet.com/sql_server/functions/case.php
https://www.techonthenet.com/mysql/functions/case.php
For example:
SELECT plantname,
CASE price
WHEN 1 THEN 'Cheap'
WHEN 2 THEN 'Expensive'
ELSE 'Unknown'
END
FROM plant