{"id":1281,"date":"2012-12-10T10:00:36","date_gmt":"2012-12-10T15:00:36","guid":{"rendered":"http:\/\/sqlity.net\/en\/?p=1281"},"modified":"2014-11-13T13:53:12","modified_gmt":"2014-11-13T18:53:12","slug":"a-join-a-day-a-self-join-experience","status":"publish","type":"post","link":"https:\/\/sqlity.net\/en\/1281\/a-join-a-day-a-self-join-experience\/","title":{"rendered":"A Join A Day \u2013 A Self-Join Experience"},"content":{"rendered":"<div>\n<h3>Introduction<\/h3>\n<p>\nThis is the tenth 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>\nA self-join is not something that is provided by a special join command. It's just a term for the pretty mundane idea of joining a table to itself. But rest assured &ndash; there is more behind it\u2026\n<\/p>\n<h3>Self-Join Example<\/h3>\n<p>\nA self-join is often used when dealing with hierarchical data. For example if you are tasked to write a report of all employees and you need to list the manager for each of them you have to join the table with all employees to itself. SQL Server 2008 introduced a new data type to handle hierarchies: <span class=\"tt\">HIERARCHYID<\/span>. The <span class=\"tt\">Employees<\/span> table in AdventureWorks2008R2 uses that data type to define the company structure. So, to identify any given employee's manager we have to use the <span class=\"tt\">GetAnchestor<\/span> method on the <span class=\"tt\">OrganizationNode<\/span> column. We can then use that value to join back to the <span class=\"tt\">Employee<\/span> table like this:\n<\/p>\n<div>\n[sql]\nSELECT<br \/>\n  Empl.LoginID AS EmplLogin, Empl.OrganizationLevel AS EmplLevel, Empl.JobTitle AS EmplJob,<br \/>\n  Mngr.LoginID AS MngrLogin, Mngr.OrganizationLevel AS MngrLevel, Mngr.JobTitle AS MngrJob<br \/>\nFROM HumanResources.Employee AS Empl<br \/>\nINNER JOIN HumanResources.Employee AS Mngr<br \/>\nON Empl.OrganizationNode.GetAncestor(1) = Mngr.OrganizationNode;<br \/>\n[\/sql]\n<\/div>\n<p>\nThe <span class=\"tt\">Employee<\/span> table does not contain the employees actual name. We could use the <span class=\"tt\">ufnGetContactInformation<\/span> function to get that information using a <span class=\"tt\">CROSS APPLY<\/span> (see <a href=\"http:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/\">A Join A Day \u2013 The Cross Apply<\/a> for details). However, for this simple example let's assume that the employee's and manager's login names are enough. The result looks like this:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/self-join-example.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/self-join-example.jpg\" alt=\"A self-join example\" title=\"A self-join example\" width=\"1093\" height=\"579\" class=\"aligncenter size-full wp-image-1284\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/self-join-example.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/self-join-example-300x158.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/self-join-example-1024x542.jpg 1024w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<h3>Self-Join Syntax<\/h3>\n<p>\nAny time you join a table to itself you are creating a self-join. There is no special syntax around this concept and you can use all the join commands we have talked about before. Additionally there is one type of self-join that does happen implicitly and does not require any join command to be spelled out at all. More about that in the next section.\n<\/p>\n<h3>Self-Join Operator<\/h3>\n<p>\nThere is also no special operator that would handle self-joins. Any of the join operators we have seen before can be used in a self-join plan. The execution plan of above employee query looks like this:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/self-join-hierarchyid-execution-plan.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/self-join-hierarchyid-execution-plan.jpg\" alt=\"Execution plan for self-join query on hierarchyid\" title=\"Execution plan for self-join query on hierarchyid\" width=\"1093\" height=\"579\" class=\"aligncenter size-full wp-image-1285\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/self-join-hierarchyid-execution-plan.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/self-join-hierarchyid-execution-plan-300x158.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/self-join-hierarchyid-execution-plan-1024x542.jpg 1024w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nYou can clearly see a merge join operator retrieving rows from two scans of the <span class=\"tt\">Employee<\/span> table. Because of the special properties of the <span class=\"tt\">HIERARCHYID<\/span> data type, SQL Server decided that the cheapest way to execute this query is to sort both inputs on the <span class=\"tt\">OrganizationNode<\/span> column and use the merge join algorithm. The four Compute Scalar operators are in the execution plan to calculate the <span class=\"tt\">OrganizationLevel<\/span> which is actually a computed column.\n<\/p>\n<p>\nThe above example is a pretty straight forward self-join query with no surprises. However, there are two other types of self-joins. The first one you might have heard of or seen before. It happens when SQL Server decides to use an index that is not covering. A covering index is an index that contains all columns that the current query is asking for. If a non-covering index is used, SQL Server has to get the remaining columns from the base table. Let's look at an example:\n<\/p>\n<div>\n[sql]\nSELECT * FROM Person.Person WHERE LastName = 'Blue';<br \/>\n[\/sql]\n<\/div>\n<p>\nThe execution plan of this simple query is shown below.\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/key-lookup-execution-plan.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/key-lookup-execution-plan.jpg\" alt=\"A key-lookup execution plan\" title=\"A key-lookup execution plan\" width=\"1093\" height=\"579\" class=\"aligncenter size-full wp-image-1283\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/key-lookup-execution-plan.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/key-lookup-execution-plan-300x158.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/key-lookup-execution-plan-1024x542.jpg 1024w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nSQL Server is using the index on LastName to find the 30 Persons with a last name of \"Blue\". Those rows are then joined with a Nested Loops (Inner Join) operator to the base table to get the remaining columns for each of them. The operator to access the base table is a Key Lookup operator in this case. A key lookup is however just a seek into the clustered index. So under the covers this is a real join operation.\n<\/p>\n<p>\nThe other implicit join I would like to show you is rarely seen. If a query asks for a subset of the columns of a table and there is no single index that covers that query, but there are two indexes that together cover all the columns, SQL Server might decide to join those two indexes together instead of accessing the base table. To see an example of this, we first have to add an additional index to the <span class=\"tt\">Person<\/span> table.\n<\/p>\n<div>\n[sql]\nCREATE INDEX [IX_Person_LastName_Suffix_Title] ON Person.Person(LastName,Suffix,Title);<br \/>\n[\/sql]\n<\/div>\n<p>\nAfter that we rerun the above query again, slightly modified to include only columns from this and one other index:\n<\/p>\n<div>\n[sql]\nSELECT  Title,<br \/>\n        FirstName,<br \/>\n        MiddleName,<br \/>\n        LastName,<br \/>\n        Suffix<br \/>\nFROM Person.Person WHERE LastName = 'Blue';<br \/>\n[\/sql]\n<\/div>\n<p>\nTo not pollute your copy of AdventureWorks2008R2, drop the index after you are done.\n<\/p>\n<div>\n[sql]\nDROP INDEX Person.Person.IX_Person_LastName_Suffix_Title;<br \/>\n[\/sql]\n<\/div>\n<p>\nThis query uses the following execution plan:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/index-index-join.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/index-index-join.jpg\" alt=\"An index to index join\" title=\"An index to index join\" width=\"1093\" height=\"579\" class=\"aligncenter size-full wp-image-1282\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/index-index-join.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/index-index-join-300x158.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/index-index-join-1024x542.jpg 1024w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nSQL Server is accessing two non-clustered indexes and joins the results with a Hash Match (Inner Join) operator. The underlying clustered index is never touched.\n<\/p>\n<h3>Summary<\/h3>\n<p>\nA self-join is not a new command. It just describes a query that joins a table to itself. There are two forms of self-joins. The explicit self-join is often used with tables that contain some kind of hierarchy. The implicit self-join on the other hand is used by SQL Server to reduce query cost. It usually joins an index to the base table using a lookup operator. But it can also happen that two non-clustered indexes are joined with each other.\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>A self-join is not something that is provided by a special join command. It&#8217;s just a term for the pretty mundane idea of joining a table to itself. But rest assured &#8211; there is more behind it\u2026 <a href=\"https:\/\/sqlity.net\/en\/1281\/a-join-a-day-a-self-join-experience\/\">[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-1281","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 v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>A Join A Day \u2013 A Self-Join Experience - sqlity.net<\/title>\n<meta name=\"description\" content=\"A self-join is not something that is provided by a special join command. It&#039;s just a term for the pretty mundane idea of joining a table to itself. But rest assured - there is more behind it\u2026\" \/>\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\/1281\/a-join-a-day-a-self-join-experience\/\" \/>\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 A Self-Join Experience - sqlity.net\" \/>\n<meta property=\"og:description\" content=\"A self-join is not something that is provided by a special join command. It&#039;s just a term for the pretty mundane idea of joining a table to itself. But rest assured - there is more behind it\u2026\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sqlity.net\/en\/1281\/a-join-a-day-a-self-join-experience\/\" \/>\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-10T15:00:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-11-13T18:53:12+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/self-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\\\/1281\\\/a-join-a-day-a-self-join-experience\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1281\\\/a-join-a-day-a-self-join-experience\\\/\"},\"author\":{\"name\":\"Sebastian Meine\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"headline\":\"A Join A Day \u2013 A Self-Join Experience\",\"datePublished\":\"2012-12-10T15:00:36+00:00\",\"dateModified\":\"2014-11-13T18:53:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1281\\\/a-join-a-day-a-self-join-experience\\\/\"},\"wordCount\":994,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1281\\\/a-join-a-day-a-self-join-experience\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/12\\\/self-join-example.jpg\",\"articleSection\":[\"A Join A Day\",\"Fundamentals\",\"General\",\"Series\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/1281\\\/a-join-a-day-a-self-join-experience\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1281\\\/a-join-a-day-a-self-join-experience\\\/\",\"url\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1281\\\/a-join-a-day-a-self-join-experience\\\/\",\"name\":\"A Join A Day \u2013 A Self-Join Experience - sqlity.net\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1281\\\/a-join-a-day-a-self-join-experience\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1281\\\/a-join-a-day-a-self-join-experience\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/12\\\/self-join-example.jpg\",\"datePublished\":\"2012-12-10T15:00:36+00:00\",\"dateModified\":\"2014-11-13T18:53:12+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"description\":\"A self-join is not something that is provided by a special join command. It's just a term for the pretty mundane idea of joining a table to itself. But rest assured - there is more behind it\u2026\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1281\\\/a-join-a-day-a-self-join-experience\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/1281\\\/a-join-a-day-a-self-join-experience\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1281\\\/a-join-a-day-a-self-join-experience\\\/#primaryimage\",\"url\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/12\\\/self-join-example.jpg\",\"contentUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/12\\\/self-join-example.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1281\\\/a-join-a-day-a-self-join-experience\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/sqlity.net\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A Join A Day \u2013 A Self-Join Experience\"}]},{\"@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 A Self-Join Experience - sqlity.net","description":"A self-join is not something that is provided by a special join command. It's just a term for the pretty mundane idea of joining a table to itself. But rest assured - there is more behind it\u2026","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\/1281\/a-join-a-day-a-self-join-experience\/","og_locale":"en_US","og_type":"article","og_title":"A Join A Day \u2013 A Self-Join Experience - sqlity.net","og_description":"A self-join is not something that is provided by a special join command. It's just a term for the pretty mundane idea of joining a table to itself. But rest assured - there is more behind it\u2026","og_url":"https:\/\/sqlity.net\/en\/1281\/a-join-a-day-a-self-join-experience\/","og_site_name":"sqlity.net","article_publisher":"https:\/\/www.facebook.com\/sqlity.net","article_published_time":"2012-12-10T15:00:36+00:00","article_modified_time":"2014-11-13T18:53:12+00:00","og_image":[{"url":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/self-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\/1281\/a-join-a-day-a-self-join-experience\/#article","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/1281\/a-join-a-day-a-self-join-experience\/"},"author":{"name":"Sebastian Meine","@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"headline":"A Join A Day \u2013 A Self-Join Experience","datePublished":"2012-12-10T15:00:36+00:00","dateModified":"2014-11-13T18:53:12+00:00","mainEntityOfPage":{"@id":"https:\/\/sqlity.net\/en\/1281\/a-join-a-day-a-self-join-experience\/"},"wordCount":994,"commentCount":0,"image":{"@id":"https:\/\/sqlity.net\/en\/1281\/a-join-a-day-a-self-join-experience\/#primaryimage"},"thumbnailUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/self-join-example.jpg","articleSection":["A Join A Day","Fundamentals","General","Series"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/sqlity.net\/en\/1281\/a-join-a-day-a-self-join-experience\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/sqlity.net\/en\/1281\/a-join-a-day-a-self-join-experience\/","url":"https:\/\/sqlity.net\/en\/1281\/a-join-a-day-a-self-join-experience\/","name":"A Join A Day \u2013 A Self-Join Experience - sqlity.net","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/sqlity.net\/en\/1281\/a-join-a-day-a-self-join-experience\/#primaryimage"},"image":{"@id":"https:\/\/sqlity.net\/en\/1281\/a-join-a-day-a-self-join-experience\/#primaryimage"},"thumbnailUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/self-join-example.jpg","datePublished":"2012-12-10T15:00:36+00:00","dateModified":"2014-11-13T18:53:12+00:00","author":{"@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"description":"A self-join is not something that is provided by a special join command. It's just a term for the pretty mundane idea of joining a table to itself. But rest assured - there is more behind it\u2026","breadcrumb":{"@id":"https:\/\/sqlity.net\/en\/1281\/a-join-a-day-a-self-join-experience\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sqlity.net\/en\/1281\/a-join-a-day-a-self-join-experience\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sqlity.net\/en\/1281\/a-join-a-day-a-self-join-experience\/#primaryimage","url":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/self-join-example.jpg","contentUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/self-join-example.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/sqlity.net\/en\/1281\/a-join-a-day-a-self-join-experience\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sqlity.net\/en\/"},{"@type":"ListItem","position":2,"name":"A Join A Day \u2013 A Self-Join Experience"}]},{"@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-kF","jetpack-related-posts":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/1281","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=1281"}],"version-history":[{"count":0,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/1281\/revisions"}],"wp:attachment":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/media?parent=1281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/categories?post=1281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/tags?post=1281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}