Re:A beginners guide to thinking in SQL
by Semiapies on Wednesday July 13, 2016 @01:21PM
(#12087932)
I haven't had trouble with complicated queries with this style. I've been doing it for ages, though.
There nothing wrong with comma-first, it's sensible; I just never got into the habit. My joins are so I can instantly glance over the tables involved in a query.
(And, oh yes, I, too, normally alias the crap out of tables if there's more than one in a query.)
On a different note, I don't like a lot of the styles I do see. I like yours, with the exception of the joins. My convention is a bit different:
Some of that is old habit (like the comma first thing which I know is out of favor with many) which I found useful when working with long column lists. I'd also typically and systematically alias the tables, but that wasn't done in the examples. Outside of tastes, the only real downside I run into is that it's easy to get too far to the right with the indentation style I use. But it's not that often that I get there.