{"id":8371,"date":"2021-02-03T08:16:00","date_gmt":"2021-02-03T08:16:00","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=8371"},"modified":"2025-09-02T04:15:07","modified_gmt":"2025-09-02T04:15:07","slug":"how-to-do-full-outer-join-in-mysql","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/","title":{"rendered":"How To Do Full Outer Join in MySQL"},"content":{"rendered":"\n<p>MySQL is a popular database system used by many database programmers and software developers. It provides several simple ways to easily retrieve data from multiple tables using JOINS. MySQL supports INNER JOIN, LEFT JOIN and RIGHT JOIN. But it does not support full outer join out of the box, unlike other databases such as PostgreSQL, and SQL Server. Often database programmers need to get query result based on FULL OUTER JOIN. So we will need to devise a work around for this. In this article, we will look at how to a full outer join in MySQL.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/#What_is_Full_Outer_Join\" >What is Full Outer Join<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/#How_To_Do_Full_Outer_Join_in_MySQL\" >How To Do Full Outer Join in MySQL<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/#Full_Join_With_Duplicates\" >Full Join With Duplicates<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/#Full_Join_Without_Duplicates\" >Full Join Without Duplicates<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_Full_Outer_Join\"><\/span>What is Full Outer Join<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Full Outer Join (also called Full Join) returns all records when there is a match in left or right table. If there is no match, then the result will contain Null values for the columns of the table that does not have a match. If you imagine two tables as two mathematical sets, a full outer join is a union of the two sets. As per SQL standards, every database system must support Full Outer Join, in addition to Inner Join, Left Join and Right Join. But MySQL does not support Full Outer Join. So you will need to do a full outer join using a combination of other join types such as LEFT JOIN and RIGHT JOIN, that are supported in MySQL. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_To_Do_Full_Outer_Join_in_MySQL\"><\/span>How To Do Full Outer Join in MySQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here are the steps to do a full outer join in MySQL. Let us say you have the following two tables <em>sales<\/em> and <em>orders<\/em>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; select * from sales;\n +------+---------------------+--------+\n | id   | order_date          | amount |\n +------+---------------------+--------+\n |    1 | 2021-02-02 08:15:00 |    250 |\n |    2 | 2021-02-02 08:30:00 |    200 |\n |    3 | 2021-02-02 08:55:00 |    150 |\n |    4 | 2021-02-02 09:15:00 |    125 |\n |    5 | 2021-02-02 09:30:00 |    250 |\n |    6 | 2021-02-02 09:45:00 |    200 |\n |    7 | 2021-02-02 10:15:00 |    180 |\n |    8 | 2021-02-02 10:30:00 |    125 |\n |    9 | 2021-02-02 10:45:00 |    200 |\n |   10 | 2021-02-02 11:15:00 |    250 |\n |   11 | 2021-02-02 11:30:00 |    150 |\n |   12 | 2021-02-02 11:45:00 |    200 |\n +------+---------------------+--------+\n\n mysql&gt; select * from orders;\n +------+------------+--------+\n | id   | order_date | amount |\n +------+------------+--------+\n |    5 | 2021-01-28 |    250 |\n |    6 | 2021-01-29 |    250 |\n |    7 | 2021-01-30 |    250 |\n |    8 | 2021-01-31 |    250 |\n |    9 | 2021-02-01 |    250 |\n +------+------------+--------+<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Full_Join_With_Duplicates\"><\/span>Full Join With Duplicates<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Here is the general syntax to do a full outer join in MySQL between tables <em>t1<\/em> and <em>t2<\/em> based on JOIN field <em>id<\/em>. You can update the table names and join field as per your requirement.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>SELECT * FROM t1 <\/code>\n<code>LEFT JOIN t2 ON t1.id = t2.id <\/code>\n<code>UNION ALL <\/code>\n<code>SELECT * FROM t1 <\/code>\n<code>RIGHT JOIN t2 ON t1.id = t2.id <\/code>\n<code>WHERE t1.id IS NULL<\/code><\/pre>\n\n\n\n<p>In the above query, the LEFT JOIN returns rows from the left table and matching rows from right table. The RIGHT JOIN will return all rows from right table and matching rows from left table. The result of right join is appended to that of left join using UNION ALL statement.<\/p>\n\n\n\n<p>The above query will also return duplicate rows, if any, since UNION ALL returns duplicates also.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Full_Join_Without_Duplicates\"><\/span>Full Join Without Duplicates<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If you don&#8217;t want duplicate records in full outer join, use JOIN instead of using JOIN ALL, in the above query.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>SELECT * FROM t1 <\/code>\n<code>LEFT JOIN t2 ON t1.id = t2.id <\/code>\n<code>UNION <\/code>\n<code>SELECT * FROM t1 <\/code>\n<code>RIGHT JOIN t2 ON t1.id = t2.id<\/code><\/pre>\n\n\n\n<p>Here is the SQL query to do a full outer join between tables <em>sales<\/em> and <em>orders<\/em>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; SELECT * FROM sales\n       LEFT JOIN orders ON sales.id = orders.id\n       UNION ALL\n       SELECT * FROM sales\n       RIGHT JOIN orders ON sales.id = orders.id\n       WHERE sales.id IS NULL ;\n +------+---------------------+--------+------+------------+--------+\n | id   | order_date          | amount | id   | order_date | amount |\n +------+---------------------+--------+------+------------+--------+\n |    5 | 2021-02-02 09:30:00 |    250 |    5 | 2021-01-28 |    250 |\n |    6 | 2021-02-02 09:45:00 |    200 |    6 | 2021-01-29 |    250 |\n |    7 | 2021-02-02 10:15:00 |    180 |    7 | 2021-01-30 |    250 |\n |    8 | 2021-02-02 10:30:00 |    125 |    8 | 2021-01-31 |    250 |\n |    9 | 2021-02-02 10:45:00 |    200 |    9 | 2021-02-01 |    250 |\n |    1 | 2021-02-02 08:15:00 |    250 | NULL | NULL       |   NULL |\n |    2 | 2021-02-02 08:30:00 |    200 | NULL | NULL       |   NULL |\n |    3 | 2021-02-02 08:55:00 |    150 | NULL | NULL       |   NULL |\n |    4 | 2021-02-02 09:15:00 |    125 | NULL | NULL       |   NULL |\n |   10 | 2021-02-02 11:15:00 |    250 | NULL | NULL       |   NULL |\n |   11 | 2021-02-02 11:30:00 |    150 | NULL | NULL       |   NULL |\n |   12 | 2021-02-02 11:45:00 |    200 | NULL | NULL       |   NULL |\n +------+---------------------+--------+------+------------+--------+<\/pre>\n\n\n\n<p>Here is the SQL query to do full outer join without any duplicate rows in result.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; SELECT * FROM sales\n       LEFT JOIN orders ON sales.id = orders.id\n       UNION\n       SELECT * FROM sales\n       RIGHT JOIN orders ON sales.id = orders.id;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, we have learnt how to do Full Joins in MySQL. Since MySQL does not support them out of the box, we need to use a combination of LEFT JOIN and RIGHT JOIN to obtain the same result as you would with a FULL JOIN, in other databases. The key is to remember to use UNION statement if you do not want duplicates in your result and use UNION ALL, if you want them.<\/p>\n\n\n\n<p>Need a reporting tool for MySQL?&nbsp;<a href=\"http:\/\/ubiq.co\/\">Ubiq<\/a>&nbsp;makes it easy to visualize data in minutes, and monitor in real-time dashboards.&nbsp;<a href=\"http:\/\/ubiq.co\/accounts\/register\">Try it<\/a>&nbsp;Today!<\/p>\n\n\n\n<p>Also read:<br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-get-row_number-in-mysql\/\">How to Get Row Number in MySQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-get-data-for-every-hour-in-mysql\/\">How to Get Data for Every Hour in MySQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-get-last-1-hour-data-in-mysql\/\">How to Get Last 1 Hour Data in MySQL<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL does not support full outer joins. Here is how to do a full outer join in MySQL.<\/p>\n","protected":false},"author":1,"featured_media":8372,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[324],"tags":[435],"class_list":["post-8371","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mysql","tag-full-outer-join"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How To Do Full Outer Join in MySQL - Ubiq BI<\/title>\n<meta name=\"description\" content=\"MySQL does not support full outer joins. Learn how to do full outer join in MySQL using LEFT JOIN and RIGHT JOIN in SQL queries.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Do Full Outer Join in MySQL - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"MySQL does not support full outer joins. Learn how to do full outer join in MySQL using LEFT JOIN and RIGHT JOIN in SQL queries.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-03T08:16:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-02T04:15:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/full-join-mysql.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"215\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-do-full-outer-join-in-mysql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-do-full-outer-join-in-mysql\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How To Do Full Outer Join in MySQL\",\"datePublished\":\"2021-02-03T08:16:00+00:00\",\"dateModified\":\"2025-09-02T04:15:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-do-full-outer-join-in-mysql\\\/\"},\"wordCount\":559,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-do-full-outer-join-in-mysql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/full-join-mysql.webp?fit=400%2C215&ssl=1\",\"keywords\":[\"full outer join\"],\"articleSection\":[\"MySQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-do-full-outer-join-in-mysql\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-do-full-outer-join-in-mysql\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-do-full-outer-join-in-mysql\\\/\",\"name\":\"How To Do Full Outer Join in MySQL - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-do-full-outer-join-in-mysql\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-do-full-outer-join-in-mysql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/full-join-mysql.webp?fit=400%2C215&ssl=1\",\"datePublished\":\"2021-02-03T08:16:00+00:00\",\"dateModified\":\"2025-09-02T04:15:07+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"MySQL does not support full outer joins. Learn how to do full outer join in MySQL using LEFT JOIN and RIGHT JOIN in SQL queries.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-do-full-outer-join-in-mysql\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-do-full-outer-join-in-mysql\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-do-full-outer-join-in-mysql\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/full-join-mysql.webp?fit=400%2C215&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/full-join-mysql.webp?fit=400%2C215&ssl=1\",\"width\":400,\"height\":215,\"caption\":\"full outer join mysql\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-do-full-outer-join-in-mysql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Do Full Outer Join in MySQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/sreeram-sreenivasan\\\/\"],\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/author\\\/wordpress\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Do Full Outer Join in MySQL - Ubiq BI","description":"MySQL does not support full outer joins. Learn how to do full outer join in MySQL using LEFT JOIN and RIGHT JOIN in SQL queries.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/","og_locale":"en_US","og_type":"article","og_title":"How To Do Full Outer Join in MySQL - Ubiq BI","og_description":"MySQL does not support full outer joins. Learn how to do full outer join in MySQL using LEFT JOIN and RIGHT JOIN in SQL queries.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2021-02-03T08:16:00+00:00","article_modified_time":"2025-09-02T04:15:07+00:00","og_image":[{"width":400,"height":215,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/full-join-mysql.webp","type":"image\/webp"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How To Do Full Outer Join in MySQL","datePublished":"2021-02-03T08:16:00+00:00","dateModified":"2025-09-02T04:15:07+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/"},"wordCount":559,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/full-join-mysql.webp?fit=400%2C215&ssl=1","keywords":["full outer join"],"articleSection":["MySQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/","name":"How To Do Full Outer Join in MySQL - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/full-join-mysql.webp?fit=400%2C215&ssl=1","datePublished":"2021-02-03T08:16:00+00:00","dateModified":"2025-09-02T04:15:07+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"MySQL does not support full outer joins. Learn how to do full outer join in MySQL using LEFT JOIN and RIGHT JOIN in SQL queries.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/full-join-mysql.webp?fit=400%2C215&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/full-join-mysql.webp?fit=400%2C215&ssl=1","width":400,"height":215,"caption":"full outer join mysql"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-do-full-outer-join-in-mysql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How To Do Full Outer Join in MySQL"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/full-join-mysql.webp?fit=400%2C215&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-2b1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=8371"}],"version-history":[{"count":2,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8371\/revisions"}],"predecessor-version":[{"id":9408,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8371\/revisions\/9408"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/8372"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=8371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=8371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=8371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}