sql-formatter icon indicating copy to clipboard operation
sql-formatter copied to clipboard

CASE WHEN dont have a line break

Open morphiaz opened this issue 9 years ago • 1 comments

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.

morphiaz avatar Sep 26 '15 20:09 morphiaz

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

JannemanDev avatar May 03 '19 21:05 JannemanDev