mirror of
https://github.com/treffynnon/sqlstyle.guide.git
synced 2025-03-09 12:49:51 -05:00
Fix CASE formatting
This commit is contained in:
parent
7b2a5fba55
commit
23242db50c
1 changed files with 27 additions and 24 deletions
|
@ -331,7 +331,8 @@ FROM table
|
|||
Or WHEN/END should have 2 space left justification, and `WHEN`/`THEN` should be indented the same as the `ELSE`/`value`.
|
||||
|
||||
```sql
|
||||
SELECT CASE
|
||||
SELECT
|
||||
CASE
|
||||
WHEN x > y AND x < z
|
||||
THEN 'x more than y but less than z'
|
||||
WHEN x > y AND x > z
|
||||
|
@ -347,7 +348,8 @@ FROM office_locations
|
|||
#### Case statements (MySql)
|
||||
|
||||
```sql
|
||||
SELECT CASE postcode
|
||||
SELECT
|
||||
CASE postcode
|
||||
WHEN 'BN1'
|
||||
THEN 'Brighton'
|
||||
WHEN 'EH1'
|
||||
|
@ -370,7 +372,8 @@ FROM office_locations
|
|||
likely should be.
|
||||
|
||||
```sql
|
||||
SELECT CASE postcode
|
||||
SELECT
|
||||
CASE postcode
|
||||
WHEN 'BN1'
|
||||
THEN 'Brighton'
|
||||
WHEN 'EH1'
|
||||
|
|
Loading…
Reference in a new issue