{"id":257,"date":"2018-04-25T11:30:03","date_gmt":"2018-04-25T04:30:03","guid":{"rendered":"http:\/\/www.sqlservertutorial.net\/?page_id=257"},"modified":"2024-02-25T22:11:12","modified_gmt":"2024-02-25T15:11:12","slug":"sql-server-left-join","status":"publish","type":"page","link":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-left-join\/","title":{"rendered":"SQL Server Left Join"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you will learn about the SQL Server <code>LEFT JOIN<\/code> clause and how to query data from multiple tables.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-sql-server-left-join-clause'>Introduction to SQL Server LEFT JOIN clause <a href=\"#introduction-to-sql-server-left-join-clause\" class=\"anchor\" id=\"introduction-to-sql-server-left-join-clause\" title=\"Anchor for Introduction to SQL Server LEFT JOIN clause\">#<\/a><\/h2>\n\n\n\n<p>The <code>LEFT JOIN<\/code> is a clause of the SELECT statement. The <code>LEFT JOIN<\/code> clause allows you to <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-select\/\">query data<\/a> from multiple tables.<\/p>\n\n\n\n<p>The <code>LEFT JOIN<\/code> returns all rows from the left table and the matching rows from the right table. If no matching rows are found in the right table, <code>NULL<\/code>&nbsp;are used.<\/p>\n\n\n\n<p>The following illustrates how to join two tables T1 and T2 using the <code>LEFT JOIN<\/code> clause:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\n    select_list\n<span class=\"hljs-keyword\">FROM<\/span>\n    T1\n<span class=\"hljs-keyword\">LEFT<\/span> <span class=\"hljs-keyword\">JOIN<\/span> T2 <span class=\"hljs-keyword\">ON<\/span>\n    join_predicate;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax, T1 and T2 are the left and right tables, respectively.<\/p>\n\n\n\n<p>For each row from the T1 table, the query compares it with all the rows from the T2 table. If a pair of rows causes the join predicate to evaluate to <code>TRUE<\/code>, the column values from these rows will be combined to form a new row which is then included in the result set.<\/p>\n\n\n\n<p>If a row from the left table (T1) does not have any matching row from the T2 table, the query combines column values of the row from the left table with <code>NULL<\/code>&nbsp;for each column value from the right table.<\/p>\n\n\n\n<p>In short, the <code>LEFT JOIN<\/code> clause returns all rows from the left table (T1) and matching rows or <code>NULL<\/code> values from the right table (T2).<\/p>\n\n\n\n<p>The following illustrates the <code>LEFT JOIN<\/code> of two tables T1(1, 2, 3) and T2(A, B, C). The <code>LEFT JOIN<\/code> will match rows from the T1 table with the rows from the T2 table using patterns:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"648\" height=\"252\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-LEFT-JOIN.png\" alt=\"SQL Server LEFT JOIN\" class=\"wp-image-474\" srcset=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-LEFT-JOIN.png 648w, https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-LEFT-JOIN-300x117.png 300w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/figure>\n\n\n\n<p>In this illustration, no row from the T2 table matches row 1 from the T1 table; therefore, NULL is used. Rows 2 and 3 from the T1 table match rows A and B from the T2 table, respectively.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='sql-server-left-join-example'>SQL Server LEFT JOIN example <a href=\"#sql-server-left-join-example\" class=\"anchor\" id=\"sql-server-left-join-example\" title=\"Anchor for SQL Server &lt;code&gt;LEFT JOIN&lt;\/code&gt; example\">#<\/a><\/h2>\n\n\n\n<p>See the following <code>products<\/code> and <code>order_items<\/code> tables:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"456\" height=\"169\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/products-order_items.png\" alt=\"The order_items &amp; products Tables\" class=\"wp-image-146\" srcset=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/products-order_items.png 456w, https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/products-order_items-300x111.png 300w\" sizes=\"auto, (max-width: 456px) 100vw, 456px\" \/><\/figure>\n\n\n\n<p>Each sales order item includes one product. The link between the <code>order_items<\/code> and the <code>products<\/code> tables is the <code>product_id<\/code> column.<\/p>\n\n\n\n<p>The following statement uses the <code>LEFT JOIN<\/code> clause to query data from the <code>products<\/code> and <code>order_items<\/code> tables:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\n    product_name,\n    order_id\n<span class=\"hljs-keyword\">FROM<\/span>\n    production.products p\n<span class=\"hljs-keyword\">LEFT<\/span> <span class=\"hljs-keyword\">JOIN<\/span> sales.order_items o <span class=\"hljs-keyword\">ON<\/span> o.product_id = p.product_id\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\n    order_id;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"293\" height=\"405\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Left-Join-example.png\" alt=\"SQL Server Left Join example\" class=\"wp-image-260\" srcset=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Left-Join-example.png 293w, https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Left-Join-example-217x300.png 217w\" sizes=\"auto, (max-width: 293px) 100vw, 293px\" \/><\/figure>\n\n\n\n<p>As you see clearly from the result set, a list of <code>NULL<\/code>&nbsp;in the <code>order_id<\/code> column indicates that the corresponding products have not been sold to any customer yet.<\/p>\n\n\n\n<p>It is possible to use the <code><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-where\/\">WHERE<\/a><\/code> clause to limit the result set. The following query returns the products that do not appear in any sales order:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\n    product_name,\n    order_id\n<span class=\"hljs-keyword\">FROM<\/span>\n    production.products p\n<span class=\"hljs-keyword\">LEFT<\/span> <span class=\"hljs-keyword\">JOIN<\/span> sales.order_items o <span class=\"hljs-keyword\">ON<\/span> o.product_id = p.product_id\n<span class=\"hljs-keyword\">WHERE<\/span> order_id <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-literal\">NULL<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"272\" height=\"284\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Left-Join-find-unmatching-rows.png\" alt=\"SQL Server Left Join find unmatching rows\" class=\"wp-image-263\"\/><\/figure>\n\n\n\n<p>As always, SQL Server processes the <code>WHERE<\/code> clause after the <code>LEFT JOIN<\/code> clause.<\/p>\n\n\n\n<p>The following example shows how to join three tables: <code>production.products<\/code>, <code>sales.orders<\/code>, and <code>sales.order_items<\/code> using the <code>LEFT JOIN<\/code> clauses:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"718\" height=\"219\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/orders-order_items-products.png\" alt=\"\" class=\"wp-image-162\" srcset=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/orders-order_items-products.png 718w, https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/orders-order_items-products-300x92.png 300w\" sizes=\"auto, (max-width: 718px) 100vw, 718px\" \/><\/figure>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\n    p.product_name,\n    o.order_id,\n    i.item_id,\n    o.order_date\n<span class=\"hljs-keyword\">FROM<\/span>\n    production.products p\n\t<span class=\"hljs-keyword\">LEFT<\/span> <span class=\"hljs-keyword\">JOIN<\/span> sales.order_items i\n\t\t<span class=\"hljs-keyword\">ON<\/span> i.product_id = p.product_id\n\t<span class=\"hljs-keyword\">LEFT<\/span> <span class=\"hljs-keyword\">JOIN<\/span> sales.orders o\n\t\t<span class=\"hljs-keyword\">ON<\/span> o.order_id = i.order_id\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\n    order_id;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Here is the output:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"431\" height=\"379\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-LEFT-JOIN-join-three-tables.png\" alt=\"SQL Server LEFT JOIN - join three tables\" class=\"wp-image-2002\" srcset=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-LEFT-JOIN-join-three-tables.png 431w, https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-LEFT-JOIN-join-three-tables-300x264.png 300w\" sizes=\"auto, (max-width: 431px) 100vw, 431px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id='sql-server-left-join-conditions-in-on-vs-where-clause'>SQL Server LEFT JOIN: conditions in ON vs. WHERE clause <a href=\"#sql-server-left-join-conditions-in-on-vs-where-clause\" class=\"anchor\" id=\"sql-server-left-join-conditions-in-on-vs-where-clause\" title=\"Anchor for SQL Server LEFT JOIN: conditions in &lt;code&gt;ON&lt;\/code&gt; vs. &lt;code&gt;WHERE&lt;\/code&gt; clause\">#<\/a><\/h2>\n\n\n\n<p>The following query finds the products that belong to order id 100:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\n    product_name,\n    order_id\n<span class=\"hljs-keyword\">FROM<\/span>\n    production.products p\n<span class=\"hljs-keyword\">LEFT<\/span> <span class=\"hljs-keyword\">JOIN<\/span> sales.order_items o \n   <span class=\"hljs-keyword\">ON<\/span> o.product_id = p.product_id\n<span class=\"hljs-keyword\">WHERE<\/span> order_id = <span class=\"hljs-number\">100<\/span>\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\n    order_id;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"325\" height=\"113\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Left-Join-and-WHERE-clause.png\" alt=\"SQL Server Left Join and WHERE clause\" class=\"wp-image-262\" srcset=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Left-Join-and-WHERE-clause.png 325w, https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Left-Join-and-WHERE-clause-300x104.png 300w\" sizes=\"auto, (max-width: 325px) 100vw, 325px\" \/><\/figure>\n\n\n\n<p>Let&#8217;s move the condition <code>order_id = 100<\/code> to the <code>ON<\/code> clause:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\n    p.product_id,\n    product_name,\n    order_id\n<span class=\"hljs-keyword\">FROM<\/span>\n    production.products p\n    <span class=\"hljs-keyword\">LEFT<\/span> <span class=\"hljs-keyword\">JOIN<\/span> sales.order_items o \n         <span class=\"hljs-keyword\">ON<\/span> o.product_id = p.product_id <span class=\"hljs-keyword\">AND<\/span> \n            o.order_id = <span class=\"hljs-number\">100<\/span>\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\n    order_id <span class=\"hljs-keyword\">DESC<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"398\" height=\"345\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-LEFT-JOIN-move-condition-to-ON-clause.png\" alt=\"SQL Server LEFT JOIN - move condition to ON clause\" class=\"wp-image-2005\" srcset=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-LEFT-JOIN-move-condition-to-ON-clause.png 398w, https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-LEFT-JOIN-move-condition-to-ON-clause-300x260.png 300w\" sizes=\"auto, (max-width: 398px) 100vw, 398px\" \/><\/figure>\n\n\n\n<p>The query returned all products, but only the order with id 100 has the associated product&#8217;s information.<\/p>\n\n\n\n<p>Note that for the <code><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-inner-join\/\">INNER JOIN<\/a><\/code> clause, the condition in the <code>ON<\/code> clause is functionally equivalent if it is placed in the <code>WHERE<\/code> clause.<\/p>\n\n\n\n<p>In this tutorial, you have learned how to use the SQL Server <code>LEFT JOIN<\/code> clause to retrieve data from multiple related tables.<\/p>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"257\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-left-join\/\"\n\t\t\t\tdata-post-title=\"SQL Server Left Join\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"257\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-left-join\/\"\n\t\t\t\tdata-post-title=\"SQL Server Left Join\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial introduces you to the SQL Server LEFT JOIN clause and shows you how to use it to query data from multiple associated tables.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":100,"menu_order":15,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-257","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SQL Server Left Join<\/title>\n<meta name=\"description\" content=\"This tutorial introduces you to the SQL Server LEFT JOIN clause and shows you how to use it to query data from multiple associated tables.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-left-join\/\" \/>\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\" \/>\n<meta property=\"og:description\" content=\"This tutorial introduces you to the SQL Server LEFT JOIN clause and shows you how to use it to query data from multiple associated tables.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-left-join\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL Server Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-25T15:11:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-LEFT-JOIN.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-left-join\\\/\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-left-join\\\/\",\"name\":\"SQL Server Left Join\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-left-join\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-left-join\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/SQL-Server-LEFT-JOIN.png\",\"datePublished\":\"2018-04-25T04:30:03+00:00\",\"dateModified\":\"2024-02-25T15:11:12+00:00\",\"description\":\"This tutorial introduces you to the SQL Server LEFT JOIN clause and shows you how to use it to query data from multiple associated tables.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-left-join\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-left-join\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-left-join\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/SQL-Server-LEFT-JOIN.png\",\"contentUrl\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/SQL-Server-LEFT-JOIN.png\",\"width\":648,\"height\":252,\"caption\":\"SQL Server LEFT JOIN\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-left-join\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server Basics\",\"item\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"SQL Server Left Join\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/#website\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/\",\"name\":\"SQL Server Tutorial\",\"description\":\"The Practical SQL Server Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL Server Left Join","description":"This tutorial introduces you to the SQL Server LEFT JOIN clause and shows you how to use it to query data from multiple associated tables.","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:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-left-join\/","og_locale":"en_US","og_type":"article","og_title":"SQL Server Left Join","og_description":"This tutorial introduces you to the SQL Server LEFT JOIN clause and shows you how to use it to query data from multiple associated tables.","og_url":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-left-join\/","og_site_name":"SQL Server Tutorial","article_modified_time":"2024-02-25T15:11:12+00:00","og_image":[{"url":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-LEFT-JOIN.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-left-join\/","url":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-left-join\/","name":"SQL Server Left Join","isPartOf":{"@id":"https:\/\/www.sqlservertutorial.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-left-join\/#primaryimage"},"image":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-left-join\/#primaryimage"},"thumbnailUrl":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-LEFT-JOIN.png","datePublished":"2018-04-25T04:30:03+00:00","dateModified":"2024-02-25T15:11:12+00:00","description":"This tutorial introduces you to the SQL Server LEFT JOIN clause and shows you how to use it to query data from multiple associated tables.","breadcrumb":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-left-join\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-left-join\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-left-join\/#primaryimage","url":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-LEFT-JOIN.png","contentUrl":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-LEFT-JOIN.png","width":648,"height":252,"caption":"SQL Server LEFT JOIN"},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-left-join\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlservertutorial.net\/"},{"@type":"ListItem","position":2,"name":"SQL Server Basics","item":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/"},{"@type":"ListItem","position":3,"name":"SQL Server Left Join"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlservertutorial.net\/#website","url":"https:\/\/www.sqlservertutorial.net\/","name":"SQL Server Tutorial","description":"The Practical SQL Server Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlservertutorial.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/257","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/comments?post=257"}],"version-history":[{"count":4,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/257\/revisions"}],"predecessor-version":[{"id":3370,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/257\/revisions\/3370"}],"up":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/100"}],"wp:attachment":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/media?parent=257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}