{"id":8384,"date":"2021-02-01T06:43:00","date_gmt":"2021-02-01T06:43:00","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=8384"},"modified":"2025-09-01T05:37:30","modified_gmt":"2025-09-01T05:37:30","slug":"how-to-show-rows-not-present-in-another-table-in-mysql","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-show-rows-not-present-in-another-table-in-mysql\/","title":{"rendered":"How to Show Rows Not Present in Another Table in MySQL"},"content":{"rendered":"\n<p>Sometimes you may need to find or select rows not present in another table in MySQL. This is mainly required in data analysis &amp; reporting where you will need to compare data across multiple tables. It is also useful for data management where you will need to perform such checks as a part of data quality control. There are a couple of ways to easily do this in MySQL. In this article, we will look at how to show rows not present in another table 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-show-rows-not-present-in-another-table-in-mysql\/#How_to_Show_Rows_Not_Present_in_Another_Table\" >How to Show Rows Not Present in Another Table<\/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-show-rows-not-present-in-another-table-in-mysql\/#1_Using_Not_In_Clause\" >1. Using Not In Clause<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-show-rows-not-present-in-another-table-in-mysql\/#2_Using_NOT_Exists_Clause\" >2. Using NOT Exists Clause<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-show-rows-not-present-in-another-table-in-mysql\/#3_Using_Left_Join\" >3. Using Left Join<\/a><\/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-show-rows-not-present-in-another-table-in-mysql\/#4_Using_Natural_Join\" >4. Using Natural Join<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-show-rows-not-present-in-another-table-in-mysql\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Show_Rows_Not_Present_in_Another_Table\"><\/span>How to Show Rows Not Present in Another Table<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here are the steps to find rows not present in another table. Let us say you have two tables <em>sales(id, order_date, amount)<\/em> and <em>orders(id, order_date, amount)<\/em>. We need to select rows that are present in sales table but not in orders table. First we will create the two tables.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; create table sales(id int, order_date date, amount int);\n\nmysql&gt; insert into sales(id, order_date, amount)\n      values(1, '2021-01-24',250),\n      (2, '2021-01-25',250),\n      (3, '2021-01-26',250),\n      (4, '2021-01-27',250),\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\nmysql&gt; select * from sales;\n +------+------------+--------+\n | id   | order_date | amount |\n +------+------------+--------+\n |    1 | 2021-01-24 |    250 |\n |    2 | 2021-01-25 |    250 |\n |    3 | 2021-01-26 |    250 |\n |    4 | 2021-01-27 |    250 |\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 +------+------------+--------+\n\nmysql&gt; create table orders(id int, order_date date, amount int);\n\nmysql&gt; insert into orders(id, order_date, amount)\n      values(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\nmysql&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 +------+------------+--------+\n<\/pre>\n\n\n\n<p>We will look at 4 ways to solve this problem. If you have columns with NULL values, then you may need to <a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-alter-column-from-null-to-not-null\/\">alter column from NULL to NOT NULL<\/a> before you run these queries.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Using_Not_In_Clause\"><\/span>1. Using Not In Clause<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you need to select rows in one table that are not present in another table, based on a column, then you can easily do this using <a href=\"https:\/\/www.w3resource.com\/mysql\/comparision-functions-and-operators\/not-in.php#google_vignette\" target=\"_blank\" rel=\"noreferrer noopener\">NOT IN<\/a> Clause as shown below. Here is its syntax.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT * FROM Table1 WHERE id NOT IN (SELECT id FROM Table2)<\/pre>\n\n\n\n<p>Here is the query to select sales rows whose order_date column value is not present in orders table.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; SELECT *<br>       FROM sales<br>       WHERE order_date NOT IN (SELECT order_date FROM orders);<br>+------+------------+--------+<br>| id   | order_date | amount |<br>+------+------------+--------+<br>|    1 | 2021-01-24 |    250 |<br>|    2 | 2021-01-25 |    250 |<br>|    3 | 2021-01-26 |    250 |<br>|    4 | 2021-01-27 |    250 |<br>+------+------------+--------+<\/pre>\n\n\n\n<p>Another alternative way to use NOT IN clause to show records not present in other table is to list all columns of your table in (&#8230;) as shown below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; SELECT * FROM sales<br>       WHERE (id,order_date,amount) <br>       NOT IN (SELECT * FROM orders);<br>+------+------------+--------+<br>| id   | order_date | amount |<br>+------+------------+--------+<br>|    1 | 2021-01-24 |    250 |<br>|    2 | 2021-01-25 |    250 |<br>|    3 | 2021-01-26 |    250 |<br>|    4 | 2021-01-27 |    250 |<br>+------+------------+--------+<\/pre>\n\n\n\n<p>Please note, you need to mention all column names of sales table in WHERE clause, else you will get an error. In this case, MySQL will match column names of sales table with those of orders table and also compare column values for each row.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; SELECT * FROM sales<br>       WHERE (id,order_date) <br>       NOT IN (SELECT * FROM orders);<br>ERROR 1241 (21000): Operand should contain 2 column(s)<\/pre>\n\n\n\n<p>Basically, NOT IN clause allows you to show rows not present in another table, based on one column, or based on all columns, nothing in between.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Using_NOT_Exists_Clause\"><\/span>2. Using NOT Exists Clause<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>MySQL provides EXISTS, UNION and NOT EXISTS clauses that help you perform SET operations with MySQL tables. By SET operations, we mean that you can treat MySQL tables &amp; query results as mathematical sets and select rows that are present in both tables, or only one of the tables. For our article, we will use the NOT EXISTS clause.<\/p>\n\n\n\n<p>Here is the SQL query to select data from <em>sales<\/em> table that is not present in <em>orders<\/em> table.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; SELECT *\n       FROM sales D\n       WHERE NOT EXISTS(SELECT * FROM orders c\n                       WHERE D.order_date = C.order_date);\n +------+------------+--------+\n | id   | order_date | amount |\n +------+------------+--------+\n |    1 | 2021-01-24 |    250 |\n |    2 | 2021-01-25 |    250 |\n |    3 | 2021-01-26 |    250 |\n |    4 | 2021-01-27 |    250 |\n +------+------------+--------+<\/pre>\n\n\n\n<p>In the above query, we use NOT EXISTS clause to select row from <em>sales<\/em> table that are not present in <em>orders<\/em> table, which are selected using subquery. In the subquery, we select only those rows from <em>orders<\/em> table whose <em>order_date<\/em> is same as that in <em>sales<\/em> table.<\/p>\n\n\n\n<p>Please note, using NOT EXISTS is the most recommended way for large data sets since it saves time and memory.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Using_Left_Join\"><\/span>3. Using Left Join<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Left join returns all rows that from left table and matching rows from right table. It returns nulls for right table columns, in case there is no match. It is these rows with null values that are of interest to us, since they are present in left table but not in right table. Here is how to use LEFT JOIN to get rows that are present in left table but not in right table.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; SELECT sales.* FROM sales <br>       LEFT JOIN orders ON sales.order_date = orders.order_date<br>       WHERE orders.order_date IS NULL;<br>+------+------------+--------+<br>| id   | order_date | amount |<br>+------+------------+--------+<br>|    1 | 2021-01-24 |    250 |<br>|    2 | 2021-01-25 |    250 |<br>|    3 | 2021-01-26 |    250 |<br>|    4 | 2021-01-27 |    250 |<br>+------+------------+--------+<\/pre>\n\n\n\n<p>Please remember to add the IS NULL clause at the end of your SQL query. That is what returns the rows present in left table but not in right table.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Using_Natural_Join\"><\/span>4. Using Natural Join<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you have too many columns in your table and it is tedious to mention all of them in your JOIN ON clause, then you can use a NATURAL LEFT JOIN which will automatically do join based on matching column names. The main difference between LEFT JOIN and NATURAL LEFT JOIN is that in LEFT JOIN we specify the JOIN columns whereas in NATURAL LEFT JOIN, MySQL automatically joins based on all matching column names.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; SELECT sales.* FROM sales <br>       NATURAL LEFT JOIN orders <br>       WHERE orders.order_date IS NULL;<br>+------+------------+--------+<br>| id   | order_date | amount |<br>+------+------------+--------+<br>|    1 | 2021-01-24 |    250 |<br>|    2 | 2021-01-25 |    250 |<br>|    3 | 2021-01-26 |    250 |<br>|    4 | 2021-01-27 |    250 |<br>+------+------------+--------+<\/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 4 different ways to find and display rows that are present in one table but not in another. Among them, the solution using NOT EXISTS works especially well for large tables since it is time and memory efficient. On the other hand, solutions using NOT IN and NATURAL LEFT JOIN have simple syntax. The solution using LEFT JOIN is memory efficient since it does not pull unnecessary data. You can use any of these methods are per your requirement.<\/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-current-week-data-in-mysql\/\">How to Get Current Week Data in MySQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/select-top-10-records-for-each-category-in-mysql\/\">Select Top 10 Records in Each Category in MySQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/common-table-expression-in-mysql\/\">Common Table Expression (CTE) in MySQL<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you may need to find rows not present in another table or select rows not present in another table. Here is how to show rows not present in another table in MySQL.<\/p>\n","protected":false},"author":1,"featured_media":8386,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[324],"tags":[439],"class_list":["post-8384","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mysql","tag-rows-not-present-in-another-table"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Show Rows Not Present in Another Table in MySQL - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Sometimes you may need to find or select rows not present in another table. Here is how to show rows not present in another table in MySQL.\" \/>\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-show-rows-not-present-in-another-table-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 Show Rows Not Present in Another Table in MySQL - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Sometimes you may need to find or select rows not present in another table. Here is how to show rows not present in another table in MySQL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-show-rows-not-present-in-another-table-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-01T06:43:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-01T05:37:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2021\/02\/exists-and-not-exists-in-mysql.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"550\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\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=\"4 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-show-rows-not-present-in-another-table-in-mysql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-show-rows-not-present-in-another-table-in-mysql\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Show Rows Not Present in Another Table in MySQL\",\"datePublished\":\"2021-02-01T06:43:00+00:00\",\"dateModified\":\"2025-09-01T05:37:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-show-rows-not-present-in-another-table-in-mysql\\\/\"},\"wordCount\":822,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-show-rows-not-present-in-another-table-in-mysql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/exists-and-not-exists-in-mysql.webp?fit=550%2C300&ssl=1\",\"keywords\":[\"rows not present in another table\"],\"articleSection\":[\"MySQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-show-rows-not-present-in-another-table-in-mysql\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-show-rows-not-present-in-another-table-in-mysql\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-show-rows-not-present-in-another-table-in-mysql\\\/\",\"name\":\"How to Show Rows Not Present in Another Table in MySQL - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-show-rows-not-present-in-another-table-in-mysql\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-show-rows-not-present-in-another-table-in-mysql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/exists-and-not-exists-in-mysql.webp?fit=550%2C300&ssl=1\",\"datePublished\":\"2021-02-01T06:43:00+00:00\",\"dateModified\":\"2025-09-01T05:37:30+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Sometimes you may need to find or select rows not present in another table. Here is how to show rows not present in another table in MySQL.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-show-rows-not-present-in-another-table-in-mysql\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-show-rows-not-present-in-another-table-in-mysql\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-show-rows-not-present-in-another-table-in-mysql\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/exists-and-not-exists-in-mysql.webp?fit=550%2C300&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/exists-and-not-exists-in-mysql.webp?fit=550%2C300&ssl=1\",\"width\":550,\"height\":300,\"caption\":\"exists and not exists in mysql\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-show-rows-not-present-in-another-table-in-mysql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Show Rows Not Present in Another Table 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 Show Rows Not Present in Another Table in MySQL - Ubiq BI","description":"Sometimes you may need to find or select rows not present in another table. Here is how to show rows not present in another table in MySQL.","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-show-rows-not-present-in-another-table-in-mysql\/","og_locale":"en_US","og_type":"article","og_title":"How to Show Rows Not Present in Another Table in MySQL - Ubiq BI","og_description":"Sometimes you may need to find or select rows not present in another table. Here is how to show rows not present in another table in MySQL.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-show-rows-not-present-in-another-table-in-mysql\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2021-02-01T06:43:00+00:00","article_modified_time":"2025-09-01T05:37:30+00:00","og_image":[{"width":550,"height":300,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2021\/02\/exists-and-not-exists-in-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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-show-rows-not-present-in-another-table-in-mysql\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-show-rows-not-present-in-another-table-in-mysql\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Show Rows Not Present in Another Table in MySQL","datePublished":"2021-02-01T06:43:00+00:00","dateModified":"2025-09-01T05:37:30+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-show-rows-not-present-in-another-table-in-mysql\/"},"wordCount":822,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-show-rows-not-present-in-another-table-in-mysql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2021\/02\/exists-and-not-exists-in-mysql.webp?fit=550%2C300&ssl=1","keywords":["rows not present in another table"],"articleSection":["MySQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/how-to-show-rows-not-present-in-another-table-in-mysql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-show-rows-not-present-in-another-table-in-mysql\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-show-rows-not-present-in-another-table-in-mysql\/","name":"How to Show Rows Not Present in Another Table in MySQL - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-show-rows-not-present-in-another-table-in-mysql\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-show-rows-not-present-in-another-table-in-mysql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2021\/02\/exists-and-not-exists-in-mysql.webp?fit=550%2C300&ssl=1","datePublished":"2021-02-01T06:43:00+00:00","dateModified":"2025-09-01T05:37:30+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Sometimes you may need to find or select rows not present in another table. Here is how to show rows not present in another table in MySQL.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-show-rows-not-present-in-another-table-in-mysql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-show-rows-not-present-in-another-table-in-mysql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-show-rows-not-present-in-another-table-in-mysql\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2021\/02\/exists-and-not-exists-in-mysql.webp?fit=550%2C300&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2021\/02\/exists-and-not-exists-in-mysql.webp?fit=550%2C300&ssl=1","width":550,"height":300,"caption":"exists and not exists in mysql"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-show-rows-not-present-in-another-table-in-mysql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Show Rows Not Present in Another Table 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\/2021\/02\/exists-and-not-exists-in-mysql.webp?fit=550%2C300&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-2be","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8384","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=8384"}],"version-history":[{"count":3,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8384\/revisions"}],"predecessor-version":[{"id":9400,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8384\/revisions\/9400"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/8386"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=8384"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=8384"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=8384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}