{"id":1252,"date":"2012-12-06T10:00:34","date_gmt":"2012-12-06T15:00:34","guid":{"rendered":"http:\/\/sqlity.net\/en\/?p=1252"},"modified":"2014-11-13T13:53:45","modified_gmt":"2014-11-13T18:53:45","slug":"a-join-a-day-the-right-outer-join","status":"publish","type":"post","link":"https:\/\/sqlity.net\/en\/1252\/a-join-a-day-the-right-outer-join\/","title":{"rendered":"A Join A Day \u2013 The Right Outer Join"},"content":{"rendered":"<div>\n<h3>Introduction<\/h3>\n<p>\nThis is the sixth 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 <span class=\"tt\">RIGHT OUTER JOIN<\/span> is very similar to the <span class=\"tt\">LEFT OUTER JOIN<\/span>.  As we have seen in the last post, the left outer join will include all rows of the first or left row source and only matching rows of the second or right row source. The right outer join does the same but with switched roles: It returns only matching rows of the first row source but includes all rows of the second row source.\n<\/p>\n<h3>RIGHT OUTER JOIN Example<\/h3>\n<p>\nLet's look at the same query that we used in the previous post but switch the order in which the tables are mentioned. If we now want the same results we need to change the <span class=\"tt\">LEFT OUTER JOIN<\/span> to a <span class=\"tt\">RIGHT OUTER JOIN<\/span> like this:\n<\/p>\n<div>\n[sql]\nSELECT at.Name AS AddressTypeName, bea.BusinessEntityID, bea.AddressID<br \/>\nFROM Person.BusinessEntityAddress AS bea<br \/>\nRIGHT OUTER JOIN Person.AddressType AS at<br \/>\nON at.AddressTypeID = bea.AddressTypeID<br \/>\nORDER BY at.AddressTypeID, bea.BusinessEntityID;<br \/>\n[\/sql]\n<\/div>\n<p>\nThe result is the same as it was in yesterday's example:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-example.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-example.jpg\" alt=\"a right outer join example\" title=\"a right outer join example\" width=\"1093\" height=\"577\" class=\"aligncenter size-full wp-image-1253\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-example.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-example-300x158.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-example-1024x540.jpg 1024w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-example-150x79.jpg 150w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nSo, <span class=\"tt\">TableA LEFT OUTER JOIN TableB<\/span> will produce the same results as <span class=\"tt\">TableB RIGHT OUTER JOIN TableA<\/span> assuming the same condition was supplied.\n<\/p>\n<p>\nJust for completeness we are going to use the <span class=\"tt\">TblA - TblB<\/span> example again. The values in both tables are the same as before. They are shown below:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/all-cases-join-example-setup1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/all-cases-join-example-setup1.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-1258\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/all-cases-join-example-setup1.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/all-cases-join-example-setup1-300x180.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/all-cases-join-example-setup1-1024x614.jpg 1024w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nThe query this time is joining <span class=\"tt\">TblA<\/span> with a right outer join to <span class=\"tt\">TblB<\/span>:\n<\/p>\n<div>\n[sql]\nSELECT *<br \/>\nFROM dbo.TblA AS A<br \/>\nRIGHT OUTER JOIN dbo.TblB AS B<br \/>\nON A.TblA_Val = B.TblB_Val;<br \/>\n[\/sql]\n<\/div>\n<p>\nThis query returns the following result:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-full-example.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-full-example.jpg\" alt=\"right outer join complete example\" title=\"right outer join complete example\" width=\"1093\" height=\"579\" class=\"aligncenter size-full wp-image-1257\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-full-example.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-full-example-300x158.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-full-example-1024x542.jpg 1024w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nAgain, rows for which matches on both sides exists are treated exactly like they would be treated in an inner join query. This time however rows from the right side that do not have a match on the left side are returned additionally. In such a case the left side columns are all valued NULL. The row for <span class=\"tt\">TblB_Val = 6<\/span> in above image shows an example of this.\n<\/p>\n<h3>RIGHT OUTER JOIN Syntax<\/h3>\n<p>\nAs is the case with the <span class=\"tt\">LEFT JOIN<\/span>, the <span class=\"tt\">OUTER<\/span> keyword is optional and most people just write <span class=\"tt\">RIGHT JOIN<\/span>. The same cautionary measures have to be taken to get the <span class=\"tt\">ON<\/span> clause right to not inadvertently turn the outer join into an inner join. For more details check out yesterday's post: <a href=\"http:\/\/sqlity.net\/en\/1227\/a-join-a-day-the-left-outer-join\/\">A Join A Day \u2013 The Left Outer Join<\/a>\n<\/p>\n<h3>RIGHT OUTER JOIN Operator<\/h3>\n<p>\nThe interesting thing about the right outer join is that SQL Server usually tries to avoid it. In fact, the execution plan of above example query is exactly the same as the one the left outer join query produced:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-join-producing-left-join-plan.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-join-producing-left-join-plan.jpg\" alt=\"A right join producing a left join plan\" title=\"A right join producing a left join plan\" width=\"1093\" height=\"577\" class=\"aligncenter size-full wp-image-1259\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-join-producing-left-join-plan.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-join-producing-left-join-plan-300x158.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-join-producing-left-join-plan-1024x540.jpg 1024w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nThe operator is the same Nested Loops (Left Outer Join) and the order of the two tables in the execution plan is the same as well. That shows that SQL Server assumes that it is better to switch the order of the tables and execute a left outer join than to leave the order alone and execute a right outer join.\n<\/p>\n<p>\nHowever, there actually is such a thing as a right outer join operator. It just requires special circumstances for you to come across one.\n<\/p>\n<p>\nTo show you the right outer join operator I had to create two new tables in the AdventureWorks2008R2 database:\n<\/p>\n<div>\n[sql]\nCREATE TABLE dbo.Parent(Id INT IDENTITY(1,1) PRIMARY KEY CLUSTERED, val INT DEFAULT CHECKSUM(NEWID()));<br \/>\nCREATE TABLE dbo.Child(Id INT IDENTITY(1,1) PRIMARY KEY CLUSTERED,ParentId INT REFERENCES dbo.Parent(Id) DEFAULT (ABS(CHECKSUM(NEWID())%10)+1), val INT DEFAULT CHECKSUM(NEWID()));<br \/>\nGO<br \/>\nMERGE dbo.Parent<br \/>\nUSING (SELECT TOP(1000000) 1 X FROM sys.columns x1 CROSS JOIN sys.columns x2 CROSS JOIN sys.columns x3 CROSS JOIN sys.columns x4)X<br \/>\nON 1=0<br \/>\nWHEN NOT MATCHED THEN INSERT DEFAULT VALUES;<br \/>\nGO<br \/>\nMERGE dbo.Child<br \/>\nUSING (SELECT TOP(1000) 1 X FROM sys.columns x1 CROSS JOIN sys.columns x2 CROSS JOIN sys.columns x3 CROSS JOIN sys.columns x4)X<br \/>\nON 1=0<br \/>\nWHEN NOT MATCHED THEN INSERT DEFAULT VALUES;<br \/>\n[\/sql]\n<\/div>\n<p>\nThe tables are <span class=\"tt\">dbo.Parent<\/span> and <span class=\"tt\">dbo.Child<\/span> with a foreign key relationship defined between them. After executing the above coed, there are one million records in the parent table. The Child table contains one thousand records that all reference one of the first ten Parent records only. The <span class=\"tt\">MERGE<\/span> statement in above script allows me to quickly insert x number of rows using only default values.\n<\/p>\n<p>\nNow let's try to run this query:\n<\/p>\n<div>\n[sql]\nSELECT *<br \/>\nFROM dbo.Child AS c<br \/>\nRIGHT OUTER JOIN dbo.Parent AS p<br \/>\nON c.ParentId = p.Id<br \/>\nORDER BY c.val,p.val;<br \/>\n[\/sql]\n<\/div>\n<p>\nIt asks for all Parent records and only matching Child records. The output looks like this:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-example-2.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-example-2.jpg\" alt=\"Second right outer join example\" title=\"Second right outer join example\" width=\"1093\" height=\"577\" class=\"aligncenter size-full wp-image-1254\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-example-2.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-example-2-300x158.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-example-2-1024x540.jpg 1024w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-example-2-150x79.jpg 150w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nAnd this time we actually get a right outer join operator in the execution plan:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-execution-plan.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-execution-plan.jpg\" alt=\"right outer join execution plan\" title=\"right outer join execution plan\" width=\"1093\" height=\"577\" class=\"aligncenter size-full wp-image-1256\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-execution-plan.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-execution-plan-300x158.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-execution-plan-1024x540.jpg 1024w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\n The yellow double arrows indicate that this query was executed utilizing parallelism. The algorithm used this time is a Hash Match (Right Outer Join). For an explanation of the differences between the algorithms I will ask you to wait a few more days. At that time we will also discover that the Nested Loops operator is actually not able to process a right outer join. Make sure you don't miss that post.\n<\/p>\n<h3>Summary<\/h3>\n<p>\nA right outer join and a left outer join are basically the same operation with switched roles of the two tables. Usually SQL Server will rearrange the order of the tables and use a left outer join operator, even if a <span class=\"tt\">RIGHT OUTER JOIN<\/span> command was used in the query. In some cases however a right outer join operator will be used.\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>On this sixth day of my A Join A Day series the topic is the right outer join. We are going to compare the right outer to the left outer join and we will see the SQL Server usually avoids them.<\/p>\n<p> <a href=\"https:\/\/sqlity.net\/en\/1252\/a-join-a-day-the-right-outer-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,23],"tags":[],"class_list":["post-1252","post","type-post","status-publish","format-standard","hentry","category-a-join-a-day","category-fundamentals","category-general","category-series","category-t-sql-statements"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>A Join A Day \u2013 The Right Outer Join - sqlity.net<\/title>\n<meta name=\"description\" content=\"On this sixth day of my A Join A Day series the topic is the right outer join. We are going to compare the right outer to the left outer join and we will see the SQL Server usually avoids them.\" \/>\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\/1252\/a-join-a-day-the-right-outer-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 Outer Join - sqlity.net\" \/>\n<meta property=\"og:description\" content=\"On this sixth day of my A Join A Day series the topic is the right outer join. We are going to compare the right outer to the left outer join and we will see the SQL Server usually avoids them.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sqlity.net\/en\/1252\/a-join-a-day-the-right-outer-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-06T15:00:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-11-13T18:53:45+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-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=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1252\\\/a-join-a-day-the-right-outer-join\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1252\\\/a-join-a-day-the-right-outer-join\\\/\"},\"author\":{\"name\":\"Sebastian Meine\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"headline\":\"A Join A Day \u2013 The Right Outer Join\",\"datePublished\":\"2012-12-06T15:00:34+00:00\",\"dateModified\":\"2014-11-13T18:53:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1252\\\/a-join-a-day-the-right-outer-join\\\/\"},\"wordCount\":1053,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1252\\\/a-join-a-day-the-right-outer-join\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/12\\\/right-outer-join-example.jpg\",\"articleSection\":[\"A Join A Day\",\"Fundamentals\",\"General\",\"Series\",\"T-SQL Statements\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/1252\\\/a-join-a-day-the-right-outer-join\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1252\\\/a-join-a-day-the-right-outer-join\\\/\",\"url\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1252\\\/a-join-a-day-the-right-outer-join\\\/\",\"name\":\"A Join A Day \u2013 The Right Outer Join - sqlity.net\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1252\\\/a-join-a-day-the-right-outer-join\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1252\\\/a-join-a-day-the-right-outer-join\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/12\\\/right-outer-join-example.jpg\",\"datePublished\":\"2012-12-06T15:00:34+00:00\",\"dateModified\":\"2014-11-13T18:53:45+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"description\":\"On this sixth day of my A Join A Day series the topic is the right outer join. We are going to compare the right outer to the left outer join and we will see the SQL Server usually avoids them.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1252\\\/a-join-a-day-the-right-outer-join\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/1252\\\/a-join-a-day-the-right-outer-join\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1252\\\/a-join-a-day-the-right-outer-join\\\/#primaryimage\",\"url\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/12\\\/right-outer-join-example.jpg\",\"contentUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/12\\\/right-outer-join-example.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1252\\\/a-join-a-day-the-right-outer-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 Outer 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 Outer Join - sqlity.net","description":"On this sixth day of my A Join A Day series the topic is the right outer join. We are going to compare the right outer to the left outer join and we will see the SQL Server usually avoids them.","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\/1252\/a-join-a-day-the-right-outer-join\/","og_locale":"en_US","og_type":"article","og_title":"A Join A Day \u2013 The Right Outer Join - sqlity.net","og_description":"On this sixth day of my A Join A Day series the topic is the right outer join. We are going to compare the right outer to the left outer join and we will see the SQL Server usually avoids them.","og_url":"https:\/\/sqlity.net\/en\/1252\/a-join-a-day-the-right-outer-join\/","og_site_name":"sqlity.net","article_publisher":"https:\/\/www.facebook.com\/sqlity.net","article_published_time":"2012-12-06T15:00:34+00:00","article_modified_time":"2014-11-13T18:53:45+00:00","og_image":[{"url":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-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":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/sqlity.net\/en\/1252\/a-join-a-day-the-right-outer-join\/#article","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/1252\/a-join-a-day-the-right-outer-join\/"},"author":{"name":"Sebastian Meine","@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"headline":"A Join A Day \u2013 The Right Outer Join","datePublished":"2012-12-06T15:00:34+00:00","dateModified":"2014-11-13T18:53:45+00:00","mainEntityOfPage":{"@id":"https:\/\/sqlity.net\/en\/1252\/a-join-a-day-the-right-outer-join\/"},"wordCount":1053,"commentCount":0,"image":{"@id":"https:\/\/sqlity.net\/en\/1252\/a-join-a-day-the-right-outer-join\/#primaryimage"},"thumbnailUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-example.jpg","articleSection":["A Join A Day","Fundamentals","General","Series","T-SQL Statements"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/sqlity.net\/en\/1252\/a-join-a-day-the-right-outer-join\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/sqlity.net\/en\/1252\/a-join-a-day-the-right-outer-join\/","url":"https:\/\/sqlity.net\/en\/1252\/a-join-a-day-the-right-outer-join\/","name":"A Join A Day \u2013 The Right Outer Join - sqlity.net","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/sqlity.net\/en\/1252\/a-join-a-day-the-right-outer-join\/#primaryimage"},"image":{"@id":"https:\/\/sqlity.net\/en\/1252\/a-join-a-day-the-right-outer-join\/#primaryimage"},"thumbnailUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-example.jpg","datePublished":"2012-12-06T15:00:34+00:00","dateModified":"2014-11-13T18:53:45+00:00","author":{"@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"description":"On this sixth day of my A Join A Day series the topic is the right outer join. We are going to compare the right outer to the left outer join and we will see the SQL Server usually avoids them.","breadcrumb":{"@id":"https:\/\/sqlity.net\/en\/1252\/a-join-a-day-the-right-outer-join\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sqlity.net\/en\/1252\/a-join-a-day-the-right-outer-join\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sqlity.net\/en\/1252\/a-join-a-day-the-right-outer-join\/#primaryimage","url":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-example.jpg","contentUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/right-outer-join-example.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/sqlity.net\/en\/1252\/a-join-a-day-the-right-outer-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 Outer 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_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2wXuw-kc","jetpack-related-posts":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/1252","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=1252"}],"version-history":[{"count":0,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/1252\/revisions"}],"wp:attachment":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/media?parent=1252"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/categories?post=1252"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/tags?post=1252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}