{"id":11923,"date":"2023-10-31T20:35:40","date_gmt":"2023-10-31T19:35:40","guid":{"rendered":"https:\/\/roglacup.com\/klaus62\/?p=11923"},"modified":"2023-11-01T18:53:16","modified_gmt":"2023-11-01T17:53:16","slug":"minus-operator","status":"publish","type":"post","link":"https:\/\/roglacup.com\/klaus62\/2023\/10\/31\/minus-operator\/","title":{"rendered":"Minus operator"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction to Oracle MINUS Operator<\/h2>\n\n\n\n<p>The Oracle\u00a0<code>MINUS<\/code>\u00a0operator compares two queries and returns\u00a0<a href=\"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-select-distinct\/\">distinct<\/a>\u00a0rows from the first\u00a0<a href=\"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-select\/\">query<\/a>\u00a0that are not output by the second query. In other words, the\u00a0<code>MINUS<\/code>\u00a0operator subtracts one result set from another.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"729\" height=\"260\" src=\"https:\/\/roglacup.com\/klaus62\/wp-content\/uploads\/2023\/10\/image-9.png\" alt=\"\" class=\"wp-image-11924\" srcset=\"https:\/\/roglacup.com\/klaus62\/wp-content\/uploads\/2023\/10\/image-9.png 729w, https:\/\/roglacup.com\/klaus62\/wp-content\/uploads\/2023\/10\/image-9-300x107.png 300w\" sizes=\"auto, (max-width: 729px) 100vw, 729px\" \/><\/figure>\n\n\n\n<p>See the following&nbsp;<code>contacts<\/code>&nbsp;and&nbsp;<code>employees<\/code>&nbsp;tables in the&nbsp;<a href=\"https:\/\/www.oracletutorial.com\/getting-started\/oracle-sample-database\/\">sample database<\/a>:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/07\/contacts-table.png\" alt=\"contacts table\" class=\"wp-image-306\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/07\/employees-table.png\" alt=\"employees table\" class=\"wp-image-86\"\/><\/figure>\n\n\n\n<p>The following statement returns distinct last names from the query to the left of the\u00a0<code>MINUS<\/code>\u00a0operator which is not also found in the right query.<\/p>\n\n\n\n<p>SELECT last_name FROM contacts MINUS SELECT last_name FROM employees ORDER BY last_name;<\/p>\n\n\n\n<p>Posted from:<a href=\"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-minus\/\">https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-minus\/<\/a><\/p>\n\n\n\n<p>Examine the description of the SALES1 table:<br><img decoding=\"async\" src=\"https:\/\/www.examtopics.com\/assets\/media\/exam-media\/04352\/0001600001.png\"><br>SALES2 is a table with the same description as SALES1.<br>Some sales data is duplicated in both tables.<br>You want to display the rows from the SALES1 table which are not present in the SALES2 table.<br>Which set operator generates the required output?<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A.&nbsp;INTERSECT<\/li>\n\n\n\n<li>B.&nbsp;UNION ALL<\/li>\n\n\n\n<li>C.&nbsp;UNION<\/li>\n\n\n\n<li>D.&nbsp;SUBTRACT<\/li>\n\n\n\n<li>E.&nbsp;MINUS<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Introduction to Oracle MINUS Operator The Oracle\u00a0MINUS\u00a0operator compares two queries and returns\u00a0distinct\u00a0rows from the first\u00a0query\u00a0that are not output by the second query. In other words, the\u00a0MINUS\u00a0operator subtracts one result set from another. See the following&nbsp;contacts&nbsp;and&nbsp;employees&nbsp;tables in the&nbsp;sample database: The following statement returns distinct last names from the query to the left of the\u00a0MINUS\u00a0operator which is&hellip;&nbsp;<a href=\"https:\/\/roglacup.com\/klaus62\/2023\/10\/31\/minus-operator\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Minus operator<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[1299],"tags":[1317],"class_list":["post-11923","post","type-post","status-publish","format-standard","hentry","category-1z0-082","tag-minus-operator"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts\/11923","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/comments?post=11923"}],"version-history":[{"count":1,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts\/11923\/revisions"}],"predecessor-version":[{"id":11925,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts\/11923\/revisions\/11925"}],"wp:attachment":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/media?parent=11923"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/categories?post=11923"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/tags?post=11923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}