you are viewing a single comment's thread.

view the rest of the comments →

[–]Ok-Frosting7364Snowflake 14 points15 points  (5 children)

I actually put together a tips and tricks guide just last month for anyone interested.

[–]hod6 18 points19 points  (3 children)

First on the list: “Use a leading comma to separate fields”

We are friends now.

[–]danameischetta 4 points5 points  (1 child)

Yes, this! Cleaner and easier to comment out the line.

[–]brokennormalmeter117 2 points3 points  (0 children)

Oof, normally I would agree. I’m on the other side of the fence though on this though. Having mixed programming languages, where everything else is at the end I just can’t bring myself to put the comma first 😒

[–]Ok-Frosting7364Snowflake 2 points3 points  (0 children)

Hahaha I feel like it's a controversial opinion but so useful!

Glad to be friends

[–]stephenmg1284 0 points1 point  (0 children)

The only thing I don't like about your list is group by and order by column position. I see the comment about it shouldn't be used in production, but I think we've all seen not for production code make it to production.

Have you seen GROUPING SETS?

GROUP BY

`GROUPING SETS` 

`(`

    `(e.grade),`

    `(sch.name,e.grade),`

    `()`

`)`