{"id":37,"date":"2007-09-15T13:56:08","date_gmt":"2007-09-15T11:56:08","guid":{"rendered":"http:\/\/gcolpart.evolix.net\/blog21\/join-syntax-changes-in-mysql-5\/"},"modified":"2007-09-15T13:56:08","modified_gmt":"2007-09-15T11:56:08","slug":"join-syntax-changes-in-mysql-5","status":"publish","type":"post","link":"https:\/\/gcolpart.evolix.net\/blog21\/join-syntax-changes-in-mysql-5\/","title":{"rendered":"JOIN syntax changes in MySQL 5"},"content":{"rendered":"<p>Migrate applications to MySQL 5 could need some rewrite. Here is one example :<\/p>\n<pre>mysql5&gt; SELECT * FROM table0, table1 JOIN table2 on table0.colA = table2.colB;\r\nERROR 1054 (42S22): Unknown column 'table0.colA' in 'on clause'<\/pre>\n<p>That&#8217;s because JOIN operator has now higher priority. Previously, this request was interpreted like <strong><em>((table 0, table1) JOIN table2)<\/em><\/strong> and now it is <strong><em>(table 0, (table1 JOIN table2))<\/em><\/strong>. A fast fix is adding parenthesis:<\/p>\n<pre>mysql5&gt; SELECT * FROM (table0, table1) JOIN table2 on table0.colA = table2.colB;<\/pre>\n<p>You can find more information in <a href=\"http:\/\/bugs.mysql.com\/bug.php?id=13832\">MYSQL bug #13832<\/a> and in <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.0\/en\/join.html\">MySQL manual (See Join Processing Changes in MySQL 5.0.12 section)<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Migrate applications to MySQL 5 could need some rewrite. Here is one example : mysql5&gt; SELECT * FROM table0, table1 JOIN table2 on table0.colA = table2.colB; ERROR 1054 (42S22): Unknown column &#8216;table0.colA&#8217; in &#8216;on clause&#8217; That&#8217;s because JOIN operator has now higher priority. Previously, this request was interpreted like ((table 0, table1) JOIN table2) and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,3],"tags":[],"class_list":["post-37","post","type-post","status-publish","format-standard","hentry","category-debian","category-english"],"_links":{"self":[{"href":"https:\/\/gcolpart.evolix.net\/blog21\/wp-json\/wp\/v2\/posts\/37","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gcolpart.evolix.net\/blog21\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gcolpart.evolix.net\/blog21\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gcolpart.evolix.net\/blog21\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gcolpart.evolix.net\/blog21\/wp-json\/wp\/v2\/comments?post=37"}],"version-history":[{"count":0,"href":"https:\/\/gcolpart.evolix.net\/blog21\/wp-json\/wp\/v2\/posts\/37\/revisions"}],"wp:attachment":[{"href":"https:\/\/gcolpart.evolix.net\/blog21\/wp-json\/wp\/v2\/media?parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gcolpart.evolix.net\/blog21\/wp-json\/wp\/v2\/categories?post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gcolpart.evolix.net\/blog21\/wp-json\/wp\/v2\/tags?post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}