{"id":6679,"date":"2022-03-10T07:41:00","date_gmt":"2022-03-10T06:41:00","guid":{"rendered":"https:\/\/expert-only.com\/?p=6679"},"modified":"2023-03-23T12:49:39","modified_gmt":"2023-03-23T11:49:39","slug":"t-sql-left-joins-with-sql-server","status":"publish","type":"post","link":"https:\/\/expert-only.com\/en\/t-sql\/t-sql-left-joins-with-sql-server\/","title":{"rendered":"SQL Server left join examples"},"content":{"rendered":"\n<p><strong>With this tutorials on SQL Server left join examples, it is possible to extract data from two or more SQL tables. The query is based on the relationships between the objects. MS SQL left joins indicate how the SQL engine should use data from one table to select rows from another table.<\/strong><\/p>\n\n\n\n<p>A join can group data from several tables, but each relationship is between two tables in the query. The query conditions indicate how to logically relate data between two tables. Thus, join conditions can be specified in the FROM clause or the WHERE clause. When using the FROM clause, it is the relationship that filters the data displayed.<\/p>\n\n\n\n<p>First, the goal of using joins is to avoid storing the same data multiple times in a database. This is called normalization of a relational database. For example, you have 2 million of lines of sales per year but only 10 different physical stores and 20,000 customers in the database.<\/p>\n\n\n\n<p>It&#8217;s better to store all the stores and customers information just once in a dedicated table. Hence you <a href=\"https:\/\/expert-only.com\/en\/dba\/clear-transaction-log\/\">reduce the database size<\/a>. And you also increase the performance.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-is-a-sql-server-left-join-query\">What is a SQL Server left join query ?<\/h2>\n\n\n\n<p>A SQL Server left join query is a way of selecting data from two or more tables by linking them using a join condition to filter the data. It is called a left join because the first table in the FROM clause is considered the left table, and it joins the data from the left table with data from the right table. Typically, a primary key in the first table and a <a href=\"https:\/\/expert-only.com\/en\/errors\/violation-of-unique-key-constraint\/\">foreign key<\/a> in the other tables are used to ensure data coherence in the database. However, physical constraints are not mandatory, and logical keys can be used.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to join data from two tables in SQL Server ?<\/h2>\n\n\n\n<p>To join two tables in SQL Server, it is quite straight forward. Simply specify the columns to display from both tables. Then use the JOIN condition in the FROM clause and the filter condition in the WHERE clause. What are the <strong>different types of T-SQL joins<\/strong> available with SQL Server ? The different <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/relational-databases\/performance\/joins?view=sql-server-ver15\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">types of joins in T-SQL<\/a> are the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Left join<\/strong><\/li>\n\n\n\n<li><strong>Left outer join<\/strong><\/li>\n\n\n\n<li>Right join<\/li>\n\n\n\n<li>Right outer join<\/li>\n\n\n\n<li>Full join<\/li>\n\n\n\n<li>Full outer join<\/li>\n\n\n\n<li>Inner join<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Here we&#8217;ll be focusing on the left joins.<\/h3>\n\n\n\n<p>To start illustrating the different types of joins with queries examples, we need some sample data. Let&#8217;s use the <strong>AdventureWorks<\/strong> database, as I&#8217;m using the MS SQL 2019 version, I downloaded the [AdventureWorks2019] db. <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/samples\/adventureworks-install-configure?view=sql-server-ver15&amp;tabs=ssms\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">All steps explained here with the links to all AdventureWorks versions<\/a>, from SQL Server 2008 R2 to SQL Server 2019.<\/p>\n\n\n\n<p>Let&#8217;s consider the Person table and the Store table.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">-- The sales person table\nSELECT TOP 15\n\t[BusinessEntityID], \n\t[TerritoryID], \n\t[SalesQuota], \n\t[Bonus], \n\t[CommissionPct], \n\t[SalesYTD], \n\t[SalesLastYear], \n\t[rowguid], \n\t[ModifiedDate]\nFROM [Sales].[SalesPerson];\n\n-- The store table\nSELECT TOP 15\n\t[BusinessEntityID], \n\t[Name], \n\t[SalesPersonID], \n\t[rowguid], \n\t[ModifiedDate]\nFROM [Sales].[Store] \nORDER BY [SalesPersonID];\n<\/pre>\n\n\n\n<p>The salesperson and the store tables are linked together with a physical constraint. Please note that the SalesPersonID from the [Sales].[Store] column is linked to the BusinessEntityID in the [Sales].[SalesPerson] table. That difference in the names of the columns is confusing. Here an extract of how the two tables, the code is from the [Sales].[Store] create table statement:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ADD\u00a0 CONSTRAINT [FK_Store_SalesPerson_SalesPersonID] FOREIGN KEY([SalesPersonID]) REFERENCES [Sales].[SalesPerson] ([BusinessEntityID])<\/pre>\n\n\n\n<p>The salesperson and the sales territory tables are also linked. Script extract from the [Sales].[SalesPerson] code:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ADD\u00a0 CONSTRAINT [FK_SalesPerson_SalesTerritory_TerritoryID] FOREIGN KEY([TerritoryID]) REFERENCES [Sales].[SalesTerritory] ([TerritoryID])<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">SQL Server left join sample queries<\/h2>\n\n\n\n<p>To illustrate a SQL Server left join query, suppose we want to display the store name and sales information of the salesperson. To do this, we need to join the SalesPerson table and the Store table using a left join. It is important to select an alias for the tables to make the query readable. The left <a href=\"https:\/\/spark.apache.org\/docs\/latest\/sql-ref-syntax-qry-select-join.html\" target=\"_blank\" rel=\"noreferrer noopener\">join is called like this<\/a> because it joins the data from the left table with data from the right table.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT \n\tperson.[BusinessEntityID],\n\tstore.[Name] as StoreName, \n\t[TerritoryID], \n\t[SalesQuota], \n\t[Bonus], \n\t[CommissionPct], \n\t[SalesYTD], \n\t[SalesLastYear], \n\tperson.[rowguid], \n\tperson.[ModifiedDate]\nFROM [Sales].[SalesPerson] person\n\tLEFT JOIN [Sales].[Store] store \n\t\ton person.BusinessEntityID = store.[SalesPersonID]\nORDER BY person.[BusinessEntityID];\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">MS SQL left outer join query example (left join vs left outer join)<\/h2>\n\n\n\n<p>In MS SQL, the LEFT JOIN and the LEFT OUTER JOIN are the same because they return the exact same set of data. To remove the data only available in the right table, you can use the WHERE clause to exclude the NULL values. For instance, you can use a query like the one below to remove the NULL values and retrieve the data only available in the left table.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT \n\tperson.[BusinessEntityID],\n\tstore.[Name] as StoreName, \n\t[TerritoryID], \n\t[SalesQuota], \n\t[Bonus], \n\t[CommissionPct], \n\t[SalesYTD], \n\t[SalesLastYear], \n\tperson.[rowguid], \n\tperson.[ModifiedDate]\nFROM [Sales].[SalesPerson] person\n\tLEFT JOIN [Sales].[Store] store \n\t\ton person.BusinessEntityID = store.[SalesPersonID]\nWHERE store.[SalesPersonID] IS NOT NULL\nORDER BY person.[BusinessEntityID];\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How to better manage T-SQL joins performance ?<\/h2>\n\n\n\n<p>To ensure optimal performance and response time for join queries, it is essential to limit the data in the FROM statement. For instance, you can limit the number of rows to be scanned by adding a filter to the left table. This will reduce the amount of data that needs to be processed. The tutorial provides several SQL Server left join examples that can be used to build MS SQL database applications.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>With this tutorials on SQL Server left join examples, it is possible to extract data from two or more SQL tables. The query is based on the relationships between the objects. MS SQL left joins indicate how the SQL <a class=\"mh-excerpt-more\" href=\"https:\/\/expert-only.com\/en\/t-sql\/t-sql-left-joins-with-sql-server\/\" title=\"SQL Server left join examples\">&#8230;<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":6702,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[454],"tags":[],"class_list":{"0":"post-6679","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-t-sql"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.7 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>SQL Server left join examples - T-SQL queries<\/title>\n<meta name=\"description\" content=\"How to write T-SQL left joins with SQL Server ? What is a left join query ? Examples to write different T-SQL left joins queries.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/expert-only.com\/en\/t-sql\/t-sql-left-joins-with-sql-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Server left join examples\" \/>\n<meta property=\"og:description\" content=\"How to write T-SQL left joins with SQL Server ? What is a left join query ? Examples to write different T-SQL left joins queries.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/expert-only.com\/en\/t-sql\/t-sql-left-joins-with-sql-server\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL and IT Tutorials\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-03-10T06:41:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-23T11:49:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/03\/coffee-A8CC7F60E0F_1920x1080.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Expert-Only\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@expert_only\" \/>\n<meta name=\"twitter:site\" content=\"@expert_only\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Expert-Only\" \/>\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:\\\/\\\/expert-only.com\\\/en\\\/t-sql\\\/t-sql-left-joins-with-sql-server\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/expert-only.com\\\/en\\\/t-sql\\\/t-sql-left-joins-with-sql-server\\\/\"},\"author\":{\"name\":\"Expert-Only\",\"@id\":\"https:\\\/\\\/expert-only.com\\\/en\\\/#\\\/schema\\\/person\\\/406a9576b52944f018739a42046873ef\"},\"headline\":\"SQL Server left join examples\",\"datePublished\":\"2022-03-10T06:41:00+00:00\",\"dateModified\":\"2023-03-23T11:49:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/expert-only.com\\\/en\\\/t-sql\\\/t-sql-left-joins-with-sql-server\\\/\"},\"wordCount\":780,\"publisher\":{\"@id\":\"https:\\\/\\\/expert-only.com\\\/en\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/expert-only.com\\\/en\\\/t-sql\\\/t-sql-left-joins-with-sql-server\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/expert-only.com\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/coffee-A8CC7F60E0F_1920x1080.jpeg\",\"articleSection\":[\"T-SQL\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/expert-only.com\\\/en\\\/t-sql\\\/t-sql-left-joins-with-sql-server\\\/\",\"url\":\"https:\\\/\\\/expert-only.com\\\/en\\\/t-sql\\\/t-sql-left-joins-with-sql-server\\\/\",\"name\":\"SQL Server left join examples - T-SQL queries\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/expert-only.com\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/expert-only.com\\\/en\\\/t-sql\\\/t-sql-left-joins-with-sql-server\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/expert-only.com\\\/en\\\/t-sql\\\/t-sql-left-joins-with-sql-server\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/expert-only.com\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/coffee-A8CC7F60E0F_1920x1080.jpeg\",\"datePublished\":\"2022-03-10T06:41:00+00:00\",\"dateModified\":\"2023-03-23T11:49:39+00:00\",\"description\":\"How to write T-SQL left joins with SQL Server ? What is a left join query ? Examples to write different T-SQL left joins queries.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/expert-only.com\\\/en\\\/t-sql\\\/t-sql-left-joins-with-sql-server\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/expert-only.com\\\/en\\\/t-sql\\\/t-sql-left-joins-with-sql-server\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/expert-only.com\\\/en\\\/t-sql\\\/t-sql-left-joins-with-sql-server\\\/#primaryimage\",\"url\":\"https:\\\/\\\/expert-only.com\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/coffee-A8CC7F60E0F_1920x1080.jpeg\",\"contentUrl\":\"https:\\\/\\\/expert-only.com\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/coffee-A8CC7F60E0F_1920x1080.jpeg\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/expert-only.com\\\/en\\\/t-sql\\\/t-sql-left-joins-with-sql-server\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"en\",\"item\":\"https:\\\/\\\/expert-only.com\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server left join examples\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/expert-only.com\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/expert-only.com\\\/en\\\/\",\"name\":\"SQL Server and Data Courses\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/expert-only.com\\\/en\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/expert-only.com\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/expert-only.com\\\/en\\\/#organization\",\"name\":\"Expert-Only\",\"url\":\"https:\\\/\\\/expert-only.com\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/expert-only.com\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/expert-only.com\\\/wp-content\\\/uploads\\\/2017\\\/09\\\/cropped-logo_Expert-Only.jpg\",\"contentUrl\":\"https:\\\/\\\/expert-only.com\\\/wp-content\\\/uploads\\\/2017\\\/09\\\/cropped-logo_Expert-Only.jpg\",\"width\":381,\"height\":174,\"caption\":\"Expert-Only\"},\"image\":{\"@id\":\"https:\\\/\\\/expert-only.com\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/ExpertOnlyCom\\\/\",\"https:\\\/\\\/x.com\\\/expert_only\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCMS5sR_FwAetB0FmciNvUaA\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/expert-only.com\\\/en\\\/#\\\/schema\\\/person\\\/406a9576b52944f018739a42046873ef\",\"name\":\"Expert-Only\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7e711e54a9f31bf0cc5e241d2149474e14ce3995669e683ae9e913aa93cd8da1?s=96&d=identicon&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7e711e54a9f31bf0cc5e241d2149474e14ce3995669e683ae9e913aa93cd8da1?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7e711e54a9f31bf0cc5e241d2149474e14ce3995669e683ae9e913aa93cd8da1?s=96&d=identicon&r=g\",\"caption\":\"Expert-Only\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"SQL Server left join examples - T-SQL queries","description":"How to write T-SQL left joins with SQL Server ? What is a left join query ? Examples to write different T-SQL left joins queries.","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:\/\/expert-only.com\/en\/t-sql\/t-sql-left-joins-with-sql-server\/","og_locale":"en_US","og_type":"article","og_title":"SQL Server left join examples","og_description":"How to write T-SQL left joins with SQL Server ? What is a left join query ? Examples to write different T-SQL left joins queries.","og_url":"https:\/\/expert-only.com\/en\/t-sql\/t-sql-left-joins-with-sql-server\/","og_site_name":"SQL and IT Tutorials","article_publisher":"https:\/\/www.facebook.com\/ExpertOnlyCom\/","article_published_time":"2022-03-10T06:41:00+00:00","article_modified_time":"2023-03-23T11:49:39+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/03\/coffee-A8CC7F60E0F_1920x1080.jpeg","type":"image\/jpeg"}],"author":"Expert-Only","twitter_card":"summary_large_image","twitter_creator":"@expert_only","twitter_site":"@expert_only","twitter_misc":{"Written by":"Expert-Only","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/expert-only.com\/en\/t-sql\/t-sql-left-joins-with-sql-server\/#article","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/t-sql-left-joins-with-sql-server\/"},"author":{"name":"Expert-Only","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef"},"headline":"SQL Server left join examples","datePublished":"2022-03-10T06:41:00+00:00","dateModified":"2023-03-23T11:49:39+00:00","mainEntityOfPage":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/t-sql-left-joins-with-sql-server\/"},"wordCount":780,"publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"image":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/t-sql-left-joins-with-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/03\/coffee-A8CC7F60E0F_1920x1080.jpeg","articleSection":["T-SQL"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/expert-only.com\/en\/t-sql\/t-sql-left-joins-with-sql-server\/","url":"https:\/\/expert-only.com\/en\/t-sql\/t-sql-left-joins-with-sql-server\/","name":"SQL Server left join examples - T-SQL queries","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/t-sql-left-joins-with-sql-server\/#primaryimage"},"image":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/t-sql-left-joins-with-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/03\/coffee-A8CC7F60E0F_1920x1080.jpeg","datePublished":"2022-03-10T06:41:00+00:00","dateModified":"2023-03-23T11:49:39+00:00","description":"How to write T-SQL left joins with SQL Server ? What is a left join query ? Examples to write different T-SQL left joins queries.","breadcrumb":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/t-sql-left-joins-with-sql-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/expert-only.com\/en\/t-sql\/t-sql-left-joins-with-sql-server\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/t-sql\/t-sql-left-joins-with-sql-server\/#primaryimage","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/03\/coffee-A8CC7F60E0F_1920x1080.jpeg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/03\/coffee-A8CC7F60E0F_1920x1080.jpeg","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/expert-only.com\/en\/t-sql\/t-sql-left-joins-with-sql-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"en","item":"https:\/\/expert-only.com\/en\/"},{"@type":"ListItem","position":2,"name":"SQL Server left join examples"}]},{"@type":"WebSite","@id":"https:\/\/expert-only.com\/en\/#website","url":"https:\/\/expert-only.com\/en\/","name":"SQL Server and Data Courses","description":"","publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/expert-only.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/expert-only.com\/en\/#organization","name":"Expert-Only","url":"https:\/\/expert-only.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","width":381,"height":174,"caption":"Expert-Only"},"image":{"@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ExpertOnlyCom\/","https:\/\/x.com\/expert_only","https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA"]},{"@type":"Person","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef","name":"Expert-Only","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/7e711e54a9f31bf0cc5e241d2149474e14ce3995669e683ae9e913aa93cd8da1?s=96&d=identicon&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/7e711e54a9f31bf0cc5e241d2149474e14ce3995669e683ae9e913aa93cd8da1?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7e711e54a9f31bf0cc5e241d2149474e14ce3995669e683ae9e913aa93cd8da1?s=96&d=identicon&r=g","caption":"Expert-Only"}}]}},"_links":{"self":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/6679","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/comments?post=6679"}],"version-history":[{"count":0,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/6679\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media\/6702"}],"wp:attachment":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media?parent=6679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/categories?post=6679"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/tags?post=6679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}