{"id":2990,"date":"2016-02-24T21:36:32","date_gmt":"2016-02-24T21:36:32","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=2990"},"modified":"2016-02-24T21:36:32","modified_gmt":"2016-02-24T21:36:32","slug":"left-join-on-mysql","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2016\/02\/24\/left-join-on-mysql\/","title":{"rendered":"Left Join on mysql"},"content":{"rendered":"<p>SQL LEFT JOIN Syntax<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nSELECT column_name(s)\nFROM table1\nLEFT JOIN table2\nON table1.column_name=table2.column_name;\n<\/pre>\n<p>or:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\nSELECT column_name(s)\nFROM table1\nLEFT OUTER JOIN table2\nON table1.column_name=table2.column_name;\n<\/pre>\n<p>PS! In some databases LEFT JOIN is called LEFT OUTER JOIN.<\/p>\n<p>Example: You have a surveys table and a services table and the id&#8217;s are both client_id<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\nselect surveys.date, surveys.client_id, surveys.score \nfrom surveys \nleft join services on surveys.client_id=services.client_id \nwhere cpu like Xeon\ngroup by surveys.client_id;\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>SQL LEFT JOIN Syntax SELECT column_name(s) FROM table1 LEFT JOIN table2 ON table1.column_name=table2.column_name; or: SELECT column_name(s) FROM table1 LEFT OUTER JOIN table2 ON table1.column_name=table2.column_name; PS! In some databases LEFT JOIN is called LEFT OUTER JOIN. Example: You have a surveys table and a services table and the id&#8217;s are both client_id select surveys.date, surveys.client_id, surveys.score &#8230; <a title=\"Left Join on mysql\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2016\/02\/24\/left-join-on-mysql\/\" aria-label=\"Read more about Left Join on mysql\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70],"tags":[],"class_list":["post-2990","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/2990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=2990"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/2990\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=2990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=2990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=2990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}