开发者

How MySQL defines the JOIN order?

开发者 https://www.devze.com 2023-03-19 15:08 出处:网络
That\'s it, the questi开发者_Go百科on is in subject.As of 5.0.12 MySQL tries to follow the SQL 2003 standard. Scroll down to the \"Join Processing Changes in MySQL 5.0.12\" section.

That's it, the questi开发者_Go百科on is in subject.


As of 5.0.12 MySQL tries to follow the SQL 2003 standard. Scroll down to the "Join Processing Changes in MySQL 5.0.12" section. http://dev.mysql.com/doc/refman/5.1/en/join.html

Basically never to commas to JOIN tables, always use the explicit JOIN syntax and MySQL joins in the order you specify (mostly).

Comma syntax (bad):

table1 JOIN table2, table3 WHERE table1.f1=table2.f1 AND ...

Explicit JOIN syntax (good):

table1 
JOIN table2 ON table1.f1=table2.f1
JOIN table3 ON table1.f1=table3.f1 ...
0

精彩评论

暂无评论...
验证码 换一张
取 消