{"id":1163,"date":"2012-12-02T10:00:10","date_gmt":"2012-12-02T15:00:10","guid":{"rendered":"http:\/\/sqlity.net\/en\/?p=1163"},"modified":"2014-11-13T13:54:11","modified_gmt":"2014-11-13T18:54:11","slug":"a-join-a-day-the-inner-join","status":"publish","type":"post","link":"https:\/\/sqlity.net\/en\/1163\/a-join-a-day-the-inner-join\/","title":{"rendered":"A Join A Day \u2013 The Inner Join"},"content":{"rendered":"<div>\n<h3>Introduction<\/h3>\n<p>\nThis is the second 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>\nIn the SQL language, joins are used to combine the data from one table with the data of another table based on a condition. The most common join type is the inner join.  An inner join can be used to retrieve all records from one table and for each of them all related records from another table.\n<\/p>\n<h3>INNER JOIN Example<\/h3>\n<p>\nLet's look at an example. Information about orders in the AdventureWorks2008R2 database is split into two tables: Sales.SalesOrderHeader and Sales.SalesOrderDetail. If you want to return for each order all order line items together with information about the order they are part of you need to pull related records, meaning records belonging to the same order,  from both tables into one result set. That is exactly what the join operator is doing:\n<\/p>\n<div>\n[sql]\nSELECT TOP (100) soh.SalesOrderID,<br \/>\n        soh.OrderDate,<br \/>\n        soh.ShipDate,<br \/>\n        sod.SalesOrderDetailID,<br \/>\n        sod.OrderQty,<br \/>\n        sod.ProductID,<br \/>\n        sod.UnitPrice<br \/>\nFROM    Sales.SalesOrderHeader AS soh<br \/>\nINNER JOIN Sales.SalesOrderDetail AS sod<br \/>\n        ON soh.SalesOrderID = sod.SalesOrderID<br \/>\nORDER BY soh.SalesOrderID DESC,<br \/>\n        sod.SalesOrderDetailID;<br \/>\n[\/sql]\n<\/div>\n<p>\nThis query takes each row from the SalesOrderHeader table and then finds all rows in the SalesOrderDetail table that match on the value in the SalesOrderId column. It then returns three columns from the OrderHeader table and four from the OrderDetail table for each matched pair:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-Results.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-Results.jpg\" alt=\"Results for Inner Join Example\" title=\"Inner-Join-Results\" width=\"1093\" height=\"606\" class=\"aligncenter size-full wp-image-1171\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-Results.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-Results-300x166.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-Results-1024x567.jpg 1024w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-Results-150x83.jpg 150w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nIn the result each row from the SalesOrderHeader table is repeated multiple times to be paired with each matching row from the SalesOrderDetail table.\n<\/p>\n<p>\nMost often an inner join is used to link up tables that have some kind of parent child relationship. However you can join on any kind of column. To show what happens if non unique values are involved in a join condition I have created two tables:\n<\/p>\n<div>\n[sql]\nCREATE TABLE dbo.TblA(TblA_Val INT, TblA_Desc VARCHAR(MAX));<br \/>\nCREATE TABLE dbo.TblB(TblB_Val INT, TblB_Desc VARCHAR(MAX));<\/p>\n<p>INSERT INTO dbo.TblA(TblA_Val, TblA_Desc)<br \/>\nVALUES (1,'A-1'),<br \/>\n       (2,'A-2'),<br \/>\n       (3,'A-3 (1st)'),<br \/>\n       (3,'A-3 (2nd)'),<br \/>\n       (4,'A-4 (1st)'),<br \/>\n       (4,'A-4 (2nd)'),<br \/>\n       (5,'A-5');<\/p>\n<p>INSERT INTO dbo.TblB(TblB_Val, TblB_Desc)<br \/>\nVALUES (2,'B-2'),<br \/>\n       (3,'B-3'),<br \/>\n       (4,'B-4 (1st)'),<br \/>\n       (4,'B-4 (2nd)'),<br \/>\n       (5,'B-5 (1st)'),<br \/>\n       (5,'B-5 (2nd)'),<br \/>\n       (6,'B-6');<br \/>\n[\/sql]\n<\/p><\/div>\n<p>\nLet's look at the result of the following inner join query:\n<\/p>\n<div>\n[sql]\nSELECT *<br \/>\nFROM dbo.TblA AS A<br \/>\nINNER JOIN dbo.TblB AS B<br \/>\nON A.TblA_Val = B.TblB_Val;<br \/>\n[\/sql]\n<\/div>\n<p>\nThe result is shown below:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/inner-join-full-example.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/inner-join-full-example.jpg\" alt=\"Full Spectrum Example for Inner Join\" title=\"Full Spectrum Example for Inner Join\" width=\"1093\" height=\"579\" class=\"aligncenter size-full wp-image-1170\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/inner-join-full-example.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/inner-join-full-example-300x158.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/inner-join-full-example-1024x542.jpg 1024w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/inner-join-full-example-150x79.jpg 150w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nAs you can see, any row from <span class=\"tt\">TblA<\/span> gets returned as often as there are matching rows in <span class=\"tt\">TblB<\/span>. There is one row with <span class=\"tt\">TblA_Val = 5<\/span> in <span class=\"tt\">TblA<\/span>. However, there are two rows with <span class=\"tt\">TblB_Val = 5<\/span> in <span class=\"tt\">TblB<\/span>. That means there are two rows for these in the result with the values from <span class=\"tt\">TblA<\/span> repeated.\n<\/p>\n<p>\nThe same is true in the other direction too as you can quickly see when looking at the rows with <span class=\"tt\">Val = 3<\/span>. When multiple rows with the same value exist on both sides, every row from the one side will get matched with every row from the other side. <span class=\"tt\">Val = 4<\/span> shows an example of that.\n<\/p>\n<h3>INNER JOIN Syntax<\/h3>\n<p>\nThe <span class=\"tt\">ON<\/span> keyword specifies the condition that must be fulfilled for rows to be considered a match. It is comparable to the <span class=\"tt\">WHERE<\/span> clause. Like the <span class=\"tt\">WHERE<\/span> clause it specifies a condition to filter out rows in the final result. However, there is an important difference. The condition in the <span class=\"tt\">ON<\/span> clause is validated during the time of the join operation whereas the condition in the <span class=\"tt\">where<\/span> clause is validated at the end of the query execution. In the case of a simple inner join the difference is not significant. In more complex join scenarios like outer joins or semi joins however it can make a huge difference where the condition is placed. Check out the next few posts in this series to see examples.\n<\/p>\n<p>\n The <span class=\"tt\">INNER<\/span> keyword in above query is optional and most people leave it out. The <span class=\"tt\">ON<\/span> clause allows to include multiple checks just like the <span class=\"tt\">WHERE<\/span> clause so if you need to match rows based on the values of more than one column just use <span class=\"tt\">AND<\/span> or <span class=\"tt\">OR<\/span> to combine multiple logical conditions. Full details about possible syntax forms of joins can be found here: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms177634.aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/ms177634.aspx<\/a>.\n<\/p>\n<p>\nThe order of the two tables does not matter for an inner join. In fact, SQL Server might decide to change the order during creation of the execution plan if it thinks the result will use fewer resources during execution.<\/p>\n<p>\nYou can have as many join clauses in a single query as you like. So to get the name of the product in above query instead of the rather meaningless ProductId, you could use just that value to join to the Product table:\n<\/p>\n<div>\n[sql]\nSELECT TOP (100) soh.SalesOrderID,<br \/>\n        soh.OrderDate,<br \/>\n        soh.ShipDate,<br \/>\n        sod.SalesOrderDetailID,<br \/>\n        sod.OrderQty,<br \/>\n        p.Name AS ProductName,<br \/>\n        sod.UnitPrice<br \/>\nFROM    Sales.SalesOrderHeader AS soh<br \/>\nINNER JOIN Sales.SalesOrderDetail AS sod<br \/>\n        ON soh.SalesOrderID = sod.SalesOrderID<br \/>\nINNER JOIN Production.Product AS p<br \/>\n        ON sod.ProductID = p.ProductID<br \/>\nORDER BY soh.SalesOrderID DESC,<br \/>\n        sod.SalesOrderDetailID;<br \/>\n[\/sql]\n<\/div>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-with-Multiple-Tables.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-with-Multiple-Tables.jpg\" alt=\"Inner Join with Multiple Tables\" title=\"Inner Join with Multiple Tables\" width=\"1093\" height=\"606\" class=\"aligncenter size-full wp-image-1166\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-with-Multiple-Tables.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-with-Multiple-Tables-300x166.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-with-Multiple-Tables-1024x567.jpg 1024w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-with-Multiple-Tables-150x83.jpg 150w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nThe number of tables in a single select is not limited by SQL Server. However, it is limited by the available resources (see <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms143432.aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/ms143432.aspx<\/a>). The more tables are involved in a query the harder it gets for SQL Server's optimizer to find a good execution plan, which can lead to suboptimal plans or in extreme cases even compilation errors. I often find queries at clients that join to some tables unnecessarily. Removing those tables from a query can greatly help with performance.\n<\/p>\n<h3>INNER JOIN Operator<\/h3>\n<p>\nTo execute joins, SQL Server has three operators at its disposal: The Nested Loop Join, the Hash Join and the Merge Join. Which one SQL Server picks for a query depends on its estimates for the number of rows coming from each of the tables. What the differences between these operators exactly are will be discussed in more detail later in this series. For now let's just look at the execution plan of the example query above:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-ExecutionPlan.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-ExecutionPlan.jpg\" alt=\"Inner Join Execution Plan\" title=\"Inner Join Execution Plan\" width=\"777\" height=\"204\" class=\"aligncenter size-full wp-image-1169\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-ExecutionPlan.jpg 777w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-ExecutionPlan-300x78.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-ExecutionPlan-150x39.jpg 150w\" sizes=\"auto, (max-width: 777px) 100vw, 777px\" \/><\/a>\n<\/p>\n<p>\nThe operator responsible for doing the heavy lifting in the join process is right in the middle, the \"Nested Loops (Inner Join)\" operator. It is pulling rows from both tables to combine them based on the join condition and then passing the combined rows on.\n<\/p>\n<p>\nHere you can directly see which of the three algorithms is used (Nested Loops) and which logical operation was requested (Inner Join).\n<\/p>\n<p>\nIf you look at the execution plan for the query above that also joined to the product table, you will see that there is a separate join operator for each <span class=\"tt\">JOIN<\/span> statement in the query:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Execution-Plan-with-Nested-Joins.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Execution-Plan-with-Nested-Joins.jpg\" alt=\"Execution Plan with Nested Joins\" title=\"Execution Plan with Nested Joins\" width=\"1093\" height=\"733\" class=\"aligncenter size-full wp-image-1168\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Execution-Plan-with-Nested-Joins.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Execution-Plan-with-Nested-Joins-300x201.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Execution-Plan-with-Nested-Joins-1024x686.jpg 1024w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Execution-Plan-with-Nested-Joins-150x100.jpg 150w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nThe right most join operator takes the SalesOrderHeader table and joins it with the SalesOrderDetail table. The left join operator takes the result of the first and joins it with the Product table. There are two things to note about this. First, any join operator can only work with two tables as input. There is no join operator that can handle more than two tables. Second, the input of a join operator does not need to be a table. Instead any execution plan operator can act as a row source on either input of the join operator. For that reason I am going to talk about \"row source\" instead of \"table\" when appropriate for the rest of this series.\n<\/p>\n<h3>Summary<\/h3>\n<p>\nThe <span class=\"tt\">INNER JOIN<\/span> is the most commonly used join operation. It takes rows from two row sources and combines them into a single result set matching rows together based on a specified condition. SQL Server has three different join algorithms at its disposal. It selects one of those based on the operation requested (inner join) and the number of rows it estimates to come from each row source.\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>This post looks at the inner join T-SQL command. After reading you will be able to use it and explain how it handles data and how to identify it in an execution plan.<\/p>\n<p> <a href=\"https:\/\/sqlity.net\/en\/1163\/a-join-a-day-the-inner-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,27,23],"tags":[],"class_list":["post-1163","post","type-post","status-publish","format-standard","hentry","category-a-join-a-day","category-fundamentals","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 Inner Join - sqlity.net<\/title>\n<meta name=\"description\" content=\"This post looks at the inner join T-SQL command. After reading you will be able to use it and explain how it handles data and how to identify it in an execution plan.\" \/>\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\/1163\/a-join-a-day-the-inner-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 Inner Join - sqlity.net\" \/>\n<meta property=\"og:description\" content=\"This post looks at the inner join T-SQL command. After reading you will be able to use it and explain how it handles data and how to identify it in an execution plan.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sqlity.net\/en\/1163\/a-join-a-day-the-inner-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-02T15:00:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-11-13T18:54:11+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-Results.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=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1163\\\/a-join-a-day-the-inner-join\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1163\\\/a-join-a-day-the-inner-join\\\/\"},\"author\":{\"name\":\"Sebastian Meine\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"headline\":\"A Join A Day \u2013 The Inner Join\",\"datePublished\":\"2012-12-02T15:00:10+00:00\",\"dateModified\":\"2014-11-13T18:54:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1163\\\/a-join-a-day-the-inner-join\\\/\"},\"wordCount\":1448,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1163\\\/a-join-a-day-the-inner-join\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/11\\\/Inner-Join-Results.jpg\",\"articleSection\":[\"A Join A Day\",\"Fundamentals\",\"Series\",\"T-SQL Statements\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/1163\\\/a-join-a-day-the-inner-join\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1163\\\/a-join-a-day-the-inner-join\\\/\",\"url\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1163\\\/a-join-a-day-the-inner-join\\\/\",\"name\":\"A Join A Day \u2013 The Inner Join - sqlity.net\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1163\\\/a-join-a-day-the-inner-join\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1163\\\/a-join-a-day-the-inner-join\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/11\\\/Inner-Join-Results.jpg\",\"datePublished\":\"2012-12-02T15:00:10+00:00\",\"dateModified\":\"2014-11-13T18:54:11+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"description\":\"This post looks at the inner join T-SQL command. After reading you will be able to use it and explain how it handles data and how to identify it in an execution plan.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1163\\\/a-join-a-day-the-inner-join\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/1163\\\/a-join-a-day-the-inner-join\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1163\\\/a-join-a-day-the-inner-join\\\/#primaryimage\",\"url\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/11\\\/Inner-Join-Results.jpg\",\"contentUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/11\\\/Inner-Join-Results.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1163\\\/a-join-a-day-the-inner-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 Inner 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 Inner Join - sqlity.net","description":"This post looks at the inner join T-SQL command. After reading you will be able to use it and explain how it handles data and how to identify it in an execution plan.","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\/1163\/a-join-a-day-the-inner-join\/","og_locale":"en_US","og_type":"article","og_title":"A Join A Day \u2013 The Inner Join - sqlity.net","og_description":"This post looks at the inner join T-SQL command. After reading you will be able to use it and explain how it handles data and how to identify it in an execution plan.","og_url":"https:\/\/sqlity.net\/en\/1163\/a-join-a-day-the-inner-join\/","og_site_name":"sqlity.net","article_publisher":"https:\/\/www.facebook.com\/sqlity.net","article_published_time":"2012-12-02T15:00:10+00:00","article_modified_time":"2014-11-13T18:54:11+00:00","og_image":[{"url":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-Results.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":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/sqlity.net\/en\/1163\/a-join-a-day-the-inner-join\/#article","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/1163\/a-join-a-day-the-inner-join\/"},"author":{"name":"Sebastian Meine","@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"headline":"A Join A Day \u2013 The Inner Join","datePublished":"2012-12-02T15:00:10+00:00","dateModified":"2014-11-13T18:54:11+00:00","mainEntityOfPage":{"@id":"https:\/\/sqlity.net\/en\/1163\/a-join-a-day-the-inner-join\/"},"wordCount":1448,"commentCount":0,"image":{"@id":"https:\/\/sqlity.net\/en\/1163\/a-join-a-day-the-inner-join\/#primaryimage"},"thumbnailUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-Results.jpg","articleSection":["A Join A Day","Fundamentals","Series","T-SQL Statements"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/sqlity.net\/en\/1163\/a-join-a-day-the-inner-join\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/sqlity.net\/en\/1163\/a-join-a-day-the-inner-join\/","url":"https:\/\/sqlity.net\/en\/1163\/a-join-a-day-the-inner-join\/","name":"A Join A Day \u2013 The Inner Join - sqlity.net","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/sqlity.net\/en\/1163\/a-join-a-day-the-inner-join\/#primaryimage"},"image":{"@id":"https:\/\/sqlity.net\/en\/1163\/a-join-a-day-the-inner-join\/#primaryimage"},"thumbnailUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-Results.jpg","datePublished":"2012-12-02T15:00:10+00:00","dateModified":"2014-11-13T18:54:11+00:00","author":{"@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"description":"This post looks at the inner join T-SQL command. After reading you will be able to use it and explain how it handles data and how to identify it in an execution plan.","breadcrumb":{"@id":"https:\/\/sqlity.net\/en\/1163\/a-join-a-day-the-inner-join\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sqlity.net\/en\/1163\/a-join-a-day-the-inner-join\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sqlity.net\/en\/1163\/a-join-a-day-the-inner-join\/#primaryimage","url":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-Results.jpg","contentUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/11\/Inner-Join-Results.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/sqlity.net\/en\/1163\/a-join-a-day-the-inner-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 Inner 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-iL","jetpack-related-posts":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/1163","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=1163"}],"version-history":[{"count":0,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/1163\/revisions"}],"wp:attachment":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/media?parent=1163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/categories?post=1163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/tags?post=1163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}