Skip to content

Commit 44ec15c

Browse files
mreid-mozchutten
authored andcommitted
Update sql_style.md
Add guidance around placement of commas
1 parent 2458057 commit 44ec15c

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

src/concepts/sql_style.md

+35
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,41 @@ WHERE
368368
sample_id = '42'
369369
```
370370

371+
## Comma at the End of the Line
372+
373+
Commas between `SELECT` elements should always be at the end of the line.
374+
For example:
375+
376+
**Good**
377+
378+
```sql
379+
SELECT
380+
client_id,
381+
os_name,
382+
submission_date
383+
FROM
384+
main_summary
385+
WHERE
386+
submission_date > '20180101'
387+
LIMIT
388+
10
389+
```
390+
391+
**Bad**
392+
393+
```sql
394+
SELECT
395+
client_id
396+
, os_name
397+
, submission_date
398+
FROM
399+
main_summary
400+
WHERE
401+
submission_date > '20180101'
402+
LIMIT
403+
10
404+
```
405+
371406
## Nested Queries
372407

373408
Do not use nested queries.

0 commit comments

Comments
 (0)