{"id":1354,"date":"2012-12-13T10:00:33","date_gmt":"2012-12-13T15:00:33","guid":{"rendered":"http:\/\/sqlity.net\/en\/?p=1354"},"modified":"2014-11-13T13:52:59","modified_gmt":"2014-11-13T18:52:59","slug":"a-join-a-day-the-right-semi-join","status":"publish","type":"post","link":"https:\/\/sqlity.net\/en\/1354\/a-join-a-day-the-right-semi-join\/","title":{"rendered":"A Join A Day \u2013 The Right Semi Join"},"content":{"rendered":"<div>\n<h3>Introduction<\/h3>\n<p>\nThis is the thirteenth post in my <a href=\"http:\/\/sqlity.net\/en\/1146\/a-join-a-day-introduction\/\">A Join A Day<\/a> series about SQL Server Joins. Make sure to let me know how I am doing or ask your burning join related questions by leaving a comment below.\n<\/p>\n<p>\nThe Right Semi Join is the exact mirror image of the Left Semi Join: For every row from the left side, matching rows from the right side are returned. No columns from the left side are returned and rows from the right are returned each at most once.\n<\/p>\n<h3>RIGHT SEMI JOIN Example<\/h3>\n<p>\nTo write a query with a logical left semi join we could use the <span class=\"tt\">EXISTS()<\/span> clause. However, there is not really a concept or statement that would result in a logical right semi join. But we can take the description above literally. That will lead us to a query like this:\n<\/p>\n<div>\n[sql]\nSELECT DISTINCT be.*<br \/>\nFROM    Person.BusinessEntityAddress AS bea<br \/>\nJOIN    Person.BusinessEntity AS be<br \/>\n        ON bea.BusinessEntityID = be.BusinessEntityID;<br \/>\n[\/sql]\n<\/div>\n<p>\nThe above query produces the following result. It is the same result that we got from <a href=\"http:\/\/sqlity.net\/en\/1348\/a-join-a-day-the-left-semi-join\/\">yesterday's <span class=\"tt\">EXISTS()<\/span> query<\/a>.\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-example.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-example.jpg\" alt=\"Logical Right Semi Join Example\" title=\"Logical Right Semi Join Example\" width=\"1093\" height=\"569\" class=\"aligncenter size-full wp-image-1358\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-example.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-example-300x156.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-example-1024x533.jpg 1024w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-example-150x78.jpg 150w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nFor this query pattern to be a true right semi join the right side columns must include a primary or unique key. Otherwise the <span class=\"tt\">DISTINCT<\/span> might combine multiple separate right side rows into one.\n<\/p>\n<p>\nThe tables in the <span class=\"tt\">TblA \u2013 TblB<\/span> example I have been using do not have a primary key. To make this example work we have to select only distinct values from the left join column before we join to the right side:\n<\/p>\n<div>\n[sql]\nSELECT b.*<br \/>\nFROM (SELECT DISTINCT TblA_Val FROM dbo.TblA) AS a<br \/>\nJOIN dbo.TblB AS b<br \/>\nON a.TblA_Val = b.TblB_Val;<br \/>\n[\/sql]\n<\/div>\n<p>\nRemember, the two tables in this example contain the following rows:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/all-cases-join-example-setup.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/all-cases-join-example-setup.jpg\" alt=\"setup for all-cases join example\" title=\"setup for all-cases join example\" width=\"1093\" height=\"656\" class=\"aligncenter size-full wp-image-1234\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/all-cases-join-example-setup.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/all-cases-join-example-setup-300x180.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/all-cases-join-example-setup-1024x614.jpg 1024w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/all-cases-join-example-setup-150x90.jpg 150w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nRunning the above query leads to this result:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-all-cases-example.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-all-cases-example.jpg\" alt=\"Example for All-Cases for logical Right Semi JOin\" title=\"Example for All-Cases for logical Right Semi JOin\" width=\"1093\" height=\"569\" class=\"aligncenter size-full wp-image-1357\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-all-cases-example.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-all-cases-example-300x156.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-all-cases-example-1024x533.jpg 1024w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-all-cases-example-150x78.jpg 150w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nOnly rows from <span class=\"tt\">TblB<\/span> for which a match in <span class=\"tt\">TblA<\/span> exists are included. Each <span class=\"tt\">TblB<\/span> row is included at most once, even if it has multiple matches in <span class=\"tt\">TblA<\/span>.\n<\/p>\n<p>\nLike the Left Semi Join, the Right Semi Join does not eliminate duplicates. So if a row on the right exists more than once, and if a match on the left exists, all of those rows will be included in the final result.\n<\/p>\n<h3>RIGHT SEMI JOIN Syntax<\/h3>\n<p>\nAs the previous section suggested there is no statement that is logically equivalent to a right semi join, so there is no syntax to discuss here. There are many ways to write a logical right semi join using the different join commands we have discussed before. However, SQL Servers optimizer might decide to not use a Right Semi Join operator for any of those queries.\n<\/p>\n<h3>RIGHT SEMI JOIN Operator<\/h3>\n<p>\nAny join query that fits the logical requirements by returning only rows from one of the two sides, each at most once might end up with a Semi Join operator. This operator can be either a Left Semi Join or a Right Semi Join operator. Even in an <span class=\"tt\">EXISTS()<\/span> query SQL Server might decide that it is better to flip the order of the tables and use a Right Semi Join operator. However, as with the Left Semi Join, there are many possible execution plans for a logical right semi join query that do not use a Right Semi Join operator and SQL Server might pick any of those for a given logical right semi join query.\n<\/p>\n<p>\nThe execution plan of the address example above actually does not contain a Right Semi Join operator:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-uses-physical-left-semi-join-operator.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-uses-physical-left-semi-join-operator.jpg\" alt=\"Logical Right Semi Join with Left Semi Join Execution Plan\" title=\"Logical Right Semi Join with Left Semi Join Execution Plan\" width=\"1093\" height=\"569\" class=\"aligncenter size-full wp-image-1355\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-uses-physical-left-semi-join-operator.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-uses-physical-left-semi-join-operator-300x156.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-uses-physical-left-semi-join-operator-1024x533.jpg 1024w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-uses-physical-left-semi-join-operator-150x78.jpg 150w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nInstead our left dominant SQL Server optimizer again decided to flip the order of the tables on us and use a Left Semi Join operator instead. To get SQL Server to use a Right Semi Join operator we have to \"pull a fast one\":\n<\/p>\n<div>\n[sql]\nSELECT DISTINCT be.*<br \/>\nFROM    Person.BusinessEntityAddress AS bea<br \/>\nJOIN    Person.BusinessEntity AS be<br \/>\n        ON bea.BusinessEntityID = be.BusinessEntityID<br \/>\nOPTION  ( HASH JOIN );<br \/>\n[\/sql]\n<\/div>\n<p>\nThe <span class=\"tt\">OPTION(HASH JOIN)<\/span> is a \"hint\" that instructs SQL Server to use the hash join algorithm. This hint clearly has nothing to do with semi joins, it just restricts the optimizer's options enough for it to pick the Right Semi Join operator as new winner for this query:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/forced-right-semi-join-operator.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/forced-right-semi-join-operator.jpg\" alt=\"Forced Right Semi Join Execution Plan\" title=\"Forced Right Semi Join Execution Plan\" width=\"1093\" height=\"569\" class=\"aligncenter size-full wp-image-1356\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/forced-right-semi-join-operator.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/forced-right-semi-join-operator-300x156.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/forced-right-semi-join-operator-1024x533.jpg 1024w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/forced-right-semi-join-operator-150x78.jpg 150w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nI am not going to explain this hint further here. Join hints are topic of day 18 of this series.\n<\/p>\n<h3>Summary<\/h3>\n<p>\nThe Right Semi Join and the Left Semi Join are the same logical operation. They just switch the roles of the left side row source and the right side row source. The Right Semi Join returns all rows from the right side that have a match on the left side, but each one of them is returned at most once.\n<\/p>\n<h3>A Join A Day<\/h3>\n<p>\nThis post is part of my December 2012 \"A Join A Day\" blog post series. You can find the table of contents with all posts published so far in the introductory post: <a href=\"http:\/\/sqlity.net\/en\/1146\/a-join-a-day-introduction\/\">A Join A Day \u2013 Introduction<\/a>. Check back there frequently throughout the month.\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The right semi join works like the left semi join, it just switches the role of the two sides. A Right Semi Join returns only rows from the right side base on the existence of matching rows on the left.<\/p>\n<p> <a href=\"https:\/\/sqlity.net\/en\/1354\/a-join-a-day-the-right-semi-join\/\">[more&#8230;]<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[28,29,5,27],"tags":[],"class_list":["post-1354","post","type-post","status-publish","format-standard","hentry","category-a-join-a-day","category-fundamentals","category-general","category-series"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>A Join A Day \u2013 The Right Semi Join - sqlity.net<\/title>\n<meta name=\"description\" content=\"The right semi join works like the left semi join, it just switches the role of the two sides. A Right Semi Join returns only rows from the right side base on the existence of matching rows on the left.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sqlity.net\/en\/1354\/a-join-a-day-the-right-semi-join\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A Join A Day \u2013 The Right Semi Join - sqlity.net\" \/>\n<meta property=\"og:description\" content=\"The right semi join works like the left semi join, it just switches the role of the two sides. A Right Semi Join returns only rows from the right side base on the existence of matching rows on the left.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sqlity.net\/en\/1354\/a-join-a-day-the-right-semi-join\/\" \/>\n<meta property=\"og:site_name\" content=\"sqlity.net\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/sqlity.net\" \/>\n<meta property=\"article:published_time\" content=\"2012-12-13T15:00:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-11-13T18:52:59+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-example.jpg\" \/>\n<meta name=\"author\" content=\"Sebastian Meine\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@sqlity\" \/>\n<meta name=\"twitter:site\" content=\"@sqlity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sebastian Meine\" \/>\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:\\\/\\\/sqlity.net\\\/en\\\/1354\\\/a-join-a-day-the-right-semi-join\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1354\\\/a-join-a-day-the-right-semi-join\\\/\"},\"author\":{\"name\":\"Sebastian Meine\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"headline\":\"A Join A Day \u2013 The Right Semi Join\",\"datePublished\":\"2012-12-13T15:00:33+00:00\",\"dateModified\":\"2014-11-13T18:52:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1354\\\/a-join-a-day-the-right-semi-join\\\/\"},\"wordCount\":851,\"commentCount\":1,\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1354\\\/a-join-a-day-the-right-semi-join\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/12\\\/logical-right-semi-join-example.jpg\",\"articleSection\":[\"A Join A Day\",\"Fundamentals\",\"General\",\"Series\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/1354\\\/a-join-a-day-the-right-semi-join\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1354\\\/a-join-a-day-the-right-semi-join\\\/\",\"url\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1354\\\/a-join-a-day-the-right-semi-join\\\/\",\"name\":\"A Join A Day \u2013 The Right Semi Join - sqlity.net\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1354\\\/a-join-a-day-the-right-semi-join\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1354\\\/a-join-a-day-the-right-semi-join\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/12\\\/logical-right-semi-join-example.jpg\",\"datePublished\":\"2012-12-13T15:00:33+00:00\",\"dateModified\":\"2014-11-13T18:52:59+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"description\":\"The right semi join works like the left semi join, it just switches the role of the two sides. A Right Semi Join returns only rows from the right side base on the existence of matching rows on the left.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1354\\\/a-join-a-day-the-right-semi-join\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/1354\\\/a-join-a-day-the-right-semi-join\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1354\\\/a-join-a-day-the-right-semi-join\\\/#primaryimage\",\"url\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/12\\\/logical-right-semi-join-example.jpg\",\"contentUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/12\\\/logical-right-semi-join-example.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1354\\\/a-join-a-day-the-right-semi-join\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/sqlity.net\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A Join A Day \u2013 The Right Semi Join\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/sqlity.net\\\/en\\\/\",\"name\":\"sqlity.net\",\"description\":\"Quality for SQL\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/sqlity.net\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\",\"name\":\"Sebastian Meine\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"caption\":\"Sebastian Meine\"},\"sameAs\":[\"http:\\\/\\\/sqlity.net\",\"https:\\\/\\\/x.com\\\/sqlity\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"A Join A Day \u2013 The Right Semi Join - sqlity.net","description":"The right semi join works like the left semi join, it just switches the role of the two sides. A Right Semi Join returns only rows from the right side base on the existence of matching rows on the left.","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:\/\/sqlity.net\/en\/1354\/a-join-a-day-the-right-semi-join\/","og_locale":"en_US","og_type":"article","og_title":"A Join A Day \u2013 The Right Semi Join - sqlity.net","og_description":"The right semi join works like the left semi join, it just switches the role of the two sides. A Right Semi Join returns only rows from the right side base on the existence of matching rows on the left.","og_url":"https:\/\/sqlity.net\/en\/1354\/a-join-a-day-the-right-semi-join\/","og_site_name":"sqlity.net","article_publisher":"https:\/\/www.facebook.com\/sqlity.net","article_published_time":"2012-12-13T15:00:33+00:00","article_modified_time":"2014-11-13T18:52:59+00:00","og_image":[{"url":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-example.jpg","type":"","width":"","height":""}],"author":"Sebastian Meine","twitter_card":"summary_large_image","twitter_creator":"@sqlity","twitter_site":"@sqlity","twitter_misc":{"Written by":"Sebastian Meine","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/sqlity.net\/en\/1354\/a-join-a-day-the-right-semi-join\/#article","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/1354\/a-join-a-day-the-right-semi-join\/"},"author":{"name":"Sebastian Meine","@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"headline":"A Join A Day \u2013 The Right Semi Join","datePublished":"2012-12-13T15:00:33+00:00","dateModified":"2014-11-13T18:52:59+00:00","mainEntityOfPage":{"@id":"https:\/\/sqlity.net\/en\/1354\/a-join-a-day-the-right-semi-join\/"},"wordCount":851,"commentCount":1,"image":{"@id":"https:\/\/sqlity.net\/en\/1354\/a-join-a-day-the-right-semi-join\/#primaryimage"},"thumbnailUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-example.jpg","articleSection":["A Join A Day","Fundamentals","General","Series"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/sqlity.net\/en\/1354\/a-join-a-day-the-right-semi-join\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/sqlity.net\/en\/1354\/a-join-a-day-the-right-semi-join\/","url":"https:\/\/sqlity.net\/en\/1354\/a-join-a-day-the-right-semi-join\/","name":"A Join A Day \u2013 The Right Semi Join - sqlity.net","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/sqlity.net\/en\/1354\/a-join-a-day-the-right-semi-join\/#primaryimage"},"image":{"@id":"https:\/\/sqlity.net\/en\/1354\/a-join-a-day-the-right-semi-join\/#primaryimage"},"thumbnailUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-example.jpg","datePublished":"2012-12-13T15:00:33+00:00","dateModified":"2014-11-13T18:52:59+00:00","author":{"@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"description":"The right semi join works like the left semi join, it just switches the role of the two sides. A Right Semi Join returns only rows from the right side base on the existence of matching rows on the left.","breadcrumb":{"@id":"https:\/\/sqlity.net\/en\/1354\/a-join-a-day-the-right-semi-join\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sqlity.net\/en\/1354\/a-join-a-day-the-right-semi-join\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sqlity.net\/en\/1354\/a-join-a-day-the-right-semi-join\/#primaryimage","url":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-example.jpg","contentUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/logical-right-semi-join-example.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/sqlity.net\/en\/1354\/a-join-a-day-the-right-semi-join\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sqlity.net\/en\/"},{"@type":"ListItem","position":2,"name":"A Join A Day \u2013 The Right Semi Join"}]},{"@type":"WebSite","@id":"https:\/\/sqlity.net\/en\/#website","url":"https:\/\/sqlity.net\/en\/","name":"sqlity.net","description":"Quality for SQL","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sqlity.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c","name":"Sebastian Meine","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","caption":"Sebastian Meine"},"sameAs":["http:\/\/sqlity.net","https:\/\/x.com\/sqlity"]}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2wXuw-lQ","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/1354","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/comments?post=1354"}],"version-history":[{"count":0,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/1354\/revisions"}],"wp:attachment":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/media?parent=1354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/categories?post=1354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/tags?post=1354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}