4 ms·
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
by bsaul 13y ago
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.