3 ms·
The "comma join" disconnects the join from the condition. It is hard to find the actual join condition between all the "where" conditions. By using JOIN ... ON
by lucio 10y ago
The "comma join" disconnects the join from the condition. It is hard to find the actual join condition between all the "where" conditions.
By using JOIN ... ON .., you explicitly link tables with their join condition and also separate join conditions from other filter conditions on the "where".
- DanielBMarkham 10y agoThe "comma join" disconnects the join from the condition. Yes, because it's more important to first know what's being joined, then traverse that list looking for how it's being joined. You get the full name in the conditionals, so it's not like it's a mystery what they attach to. But I have grey hair, so there you go.... :) Comma syntax makes much more sense to me. But now I know that this is not The Way Things Are Done. I also learned from the comments that comma-first isn't recommended. So now my code will be more legible. It's all good.
- lucio 10y agoI'm 45. I'm so old that I'm proficient using (+) to code outer joins in oracle :) Comma-join was the standard for me, and I had a hate-phase towards LEFT/RIGHT JOIN. But I must admin that once I've really tried the "new" join-on syntax it has great advantages that outweighs the pain of change.
- DanielBMarkham 10y agoThanks. Good to hear! I'm 51, and I'm a "full stack" programmer, which used to just be a regular programmer before everybody started overspecializing. When I learned programming, you met a guy, he told you what he wanted, and you made the computer do that. You didn't say "But I'm just the Java guy" It wasn't that you were an expert in a dozen things, you just figured out whatever the heck you had to do. I've kept with this philosophy and it's served me well. So I dive in and out of SQL. I picked up my habits on SQL intensive projects in the 80s and 90s. It'll be difficult for me to switch until I get into a spot where I'm using it heavily for a week or two. Hopefully I'll remember this thread then and give the new way a shot. Sounds freaky, but hell, I wasn't crazy about pointer arithmetic when I first heard about it either. :)