News for hackers. Stuff that matters.
Re:Easy Steps to a Complete Understanding of SQL by bsaul on Tuesday September 03, 2013 @05:07PM (#6323762)
The most beneficial thing you can do when you start with SQL is to NEVER EVER put join clauses in the WHERE section. ALWAYS put the join clauses as close to the table you're joining as possible.

eg : never do SELECT * FROM A JOIN B WHERE A.ID = B.a_id and B.id > 10 but always JOIN B ON A.ID = B.a_id AND B.id > 10

the second way of doing "scale" much much better when you add more tables, and start mixing left and right joins.

There are no comments on this comment yet.