{"id":248,"date":"2016-03-26T02:34:12","date_gmt":"2016-03-26T02:34:12","guid":{"rendered":"https:\/\/sqltutorial.org\/?page_id=248"},"modified":"2025-02-09T18:23:24","modified_gmt":"2025-02-10T01:23:24","slug":"sql-left-join","status":"publish","type":"page","link":"https:\/\/www.sqltutorial.org\/sql-left-join\/","title":{"rendered":"SQL LEFT JOIN"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn how to use the SQL <code>LEFT JOIN<\/code> clause to merge rows from two tables.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-sql-left-join-clause'>Introduction to SQL LEFT JOIN clause <a href=\"#introduction-to-sql-left-join-clause\" class=\"anchor\" id=\"introduction-to-sql-left-join-clause\" title=\"Anchor for Introduction to SQL LEFT JOIN clause\">#<\/a><\/h2>\n\n\n\n<p>The <code>LEFT JOIN<\/code> clause is an optional clause of the <code><a href=\"https:\/\/www.sqltutorial.org\/sql-select\/\">SELECT<\/a><\/code> statement. The <code>LEFT JOIN<\/code> clause allows you to merge rows from two tables.<\/p>\n\n\n\n<p>Here&#8217;s the syntax of <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  column1,\n  column2\n<span class=\"hljs-keyword\">FROM<\/span>\n  left_table\n  <span class=\"hljs-keyword\">LEFT<\/span> <span class=\"hljs-keyword\">JOIN<\/span> right_table <span class=\"hljs-keyword\">ON<\/span> condition;<\/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:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, specify the left table in the&nbsp;<code>FROM<\/code>&nbsp;clause (<code>left_table<\/code>)<\/li>\n\n\n\n<li>Second, provide the right table you want to merge rows with the left table in the&nbsp;<code>LEFT JOIN<\/code>&nbsp;clause (<code>right_table<\/code>).<\/li>\n\n\n\n<li>Third, define a <code>condition<\/code> for matching rows between two tables after the&nbsp;<code>ON<\/code>&nbsp;keyword.<\/li>\n<\/ul>\n\n\n\n<p>The <code>LEFT JOIN<\/code> clause matches every row from the left table (<code>left_table<\/code>) with every row from the right table (<code>right_table<\/code>) based on the <code>condition<\/code>.<\/p>\n\n\n\n<p>If the <code>condition<\/code> is <code>true<\/code>, the <code>LEFT JOIN<\/code> merges the rows from both tables into a single row. Otherwise, it also combines the row from the left table with the row from the right table.<\/p>\n\n\n\n<p>However, there is no matching row from the right table. In this case, the <code>LEFT JOIN<\/code> fills the columns of the row in the right table (<code>right<\/code>) with <code>NULLs<\/code> and merges it with the row from the left table.<\/p>\n\n\n\n<p>Unlike an <code><a href=\"https:\/\/www.sqltutorial.org\/sql-inner-join\/\">INNER JOIN<\/a><\/code> clause, the <code>LEFT JOIN<\/code> clause always includes all rows from the left table.<\/p>\n\n\n\n<p class=\"note\">The <code>LEFT JOIN<\/code> and <code>LEFT OUTER JOIN<\/code> are the same because the <code>OUTER<\/code> keyword is optional.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"block-cccb647e-2a52-4339-bf96-312d1fa3fbb7\" id='understanding-sql-left-join'>Understanding SQL left join <a href=\"#understanding-sql-left-join\" class=\"anchor\" id=\"understanding-sql-left-join\" title=\"Anchor for Understanding SQL left join\">#<\/a><\/h2>\n\n\n\n<p id=\"block-973a91d0-8e1f-4bc3-9f01-c5e188962280\">Suppose you have two tables:<\/p>\n\n\n\n<ul id=\"block-1e3e94a1-323e-470b-a6d5-45d84dba0705\" class=\"wp-block-list\">\n<li>The <code>X<\/code> table has two columns <code>id <\/code>(key) and <code>x<\/code>.<\/li>\n\n\n\n<li>The <code>Y<\/code> table also has two columns <code>id<\/code> (key) and <code>y<\/code>.<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><div class=\"wp-block-image\">\n<figure class=\"alignright size-full\"><img decoding=\"async\" src=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2025\/02\/x-table.svg\" alt=\"\" class=\"wp-image-3507\"\/><\/figure>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><div class=\"wp-block-image\">\n<figure class=\"alignleft size-full\"><img decoding=\"async\" src=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2025\/02\/y-table.svg\" alt=\"\" class=\"wp-image-3508\"\/><\/figure>\n<\/div><\/div>\n<\/div>\n\n\n\n<p id=\"block-9b68ea9c-7eaa-4068-8a60-47d522b4824c\">The left join matches the rows between the tables <code>X<\/code> and <code>Y<\/code> using the values in the <code>id<\/code> columns of both tables.<\/p>\n\n\n\n<p id=\"block-f9122cb8-98f4-4c80-93ea-f45a8ab4fb5a\">The left join&nbsp;includes all rows from the left table (<code>X<\/code>) and matching rows from the right table (Y); if there are no matching rows, it uses <code>null<\/code> for columns of the right table (<code>Y<\/code>):<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2025\/02\/sql-left-join-visualization.svg\" alt=\"sql left join visualization\" class=\"wp-image-3515\"\/><\/figure>\n<\/div>\n\n\n<p id=\"block-e35f00e0-40b4-4c61-a1f4-d7a18724a9a1\">The following Venn diagram is another way to illustrate a left join:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2025\/02\/sql-left-join-Venn-diagram.svg\" alt=\"sql left join Venn diagram\" class=\"wp-image-3516\"\/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id='sql-left-join-clause-example'>SQL LEFT JOIN clause example <a href=\"#sql-left-join-clause-example\" class=\"anchor\" id=\"sql-left-join-clause-example\" title=\"Anchor for SQL LEFT JOIN clause example\">#<\/a><\/h2>\n\n\n\n<p>Suppose we have two tables <code>employees<\/code> and <code>departments<\/code>.<\/p>\n\n\n\n<p>The <code>employees<\/code> table has three columns <code>employee_id<\/code>, <code>name<\/code>, and <code>department_id<\/code>:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>employee_id<\/th><th>name<\/th><th>department_id<\/th><\/tr><\/thead><tbody><tr><td>1<\/td><td>Jane<\/td><td>1<\/td><\/tr><tr><td>2<\/td><td>Bob<\/td><td>2<\/td><\/tr><tr><td>3<\/td><td>Maria<\/td><td>NULL<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The <code>departments<\/code> table has two columns <code>department_id<\/code> and <code>department_name<\/code>:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>department_id<\/th><th>department_name<\/th><\/tr><\/thead><tbody><tr><td>1<\/td><td>Sales<\/td><\/tr><tr><td>2<\/td><td>Marketing<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The following query retrieves the <code>employee_id<\/code> and <code>name<\/code> from the <code>employees<\/code> table and <code>department_name<\/code> from the <code>departments<\/code> tables using a <code>LEFT JOIN<\/code> clause:<\/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  employee_id,\n  <span class=\"hljs-keyword\">name<\/span>,\n  department_name\n<span class=\"hljs-keyword\">FROM<\/span>\n  employees \n  <span class=\"hljs-keyword\">LEFT<\/span> <span class=\"hljs-keyword\">JOIN<\/span> departments <span class=\"hljs-keyword\">ON<\/span> departments.department_id = employees.department_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<p><a href=\"https:\/\/www.sqltutorial.org\/playground\/?db=join&amp;q=U0VMRUNUIGVtcGxveWVlX2lkLCBuYW1lLCBkZXBhcnRtZW50X25hbWUgRlJPTSBlbXBsb3llZXMgTEVGVCBKT0lOIGRlcGFydG1lbnRzIE9OIGRlcGFydG1lbnRzLmRlcGFydG1lbnRfaWQgPSBlbXBsb3llZXMuZGVwYXJ0bWVudF9pZDs%3D\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\"> employee_id | name  | department_name\n-------------+-------+-----------------\n           1 | Jane  | Sales\n           2 | Bob   | Marketing\n           3 | Maria | NULL<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>How the query works.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Step 1. The <code>LEFT JOIN<\/code> clause compares the value in the <code>department_id<\/code> column of the <code>employees<\/code> table with the value in the <code>department_id<\/code> of the <code>departments<\/code> table. If they are equal, the <code>LEFT JOIN<\/code> clause merges the rows from both tables into a single row. If not, the <code>LEFT JOIN <\/code> fills in <code>NULL<\/code> for columns of the row from the <code>departments<\/code> table and merge it with the row in the <code>employees<\/code> table.<\/li>\n\n\n\n<li>Step 2. The query returns a row with the columns specified in the <code>SELECT<\/code> clause.<\/li>\n<\/ul>\n\n\n\n<p>The row #1 in the <code>employees<\/code> table (<code>department_id<\/code> 1) matches with the row #1 in the <code>departments<\/code> table (<code>department_id<\/code> 1). The <code>LEFT JOIN<\/code> clause combines the rows from both tables into a single row like this:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>employee_id<\/th><th>name<\/th><th>department_id<\/th><th>department_id<\/th><th>department_name<\/th><\/tr><\/thead><tbody><tr><td>1<\/td><td>Jane<\/td><td>1<\/td><td>1<\/td><td>Sales<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The row #2 in the <code>employees<\/code> table (<code>department_id<\/code> 2) matches with the row #2 in the <code>departments<\/code> table (<code>departement_id<\/code> 2). The <code>LEFT JOIN<\/code> combines the rows from both tables into a single row:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>employee_id<\/th><th>name<\/th><th>department_id<\/th><th>department_id<\/th><th>department_name<\/th><\/tr><\/thead><tbody><tr><td>2<\/td><td>Bob<\/td><td>2<\/td><td>2<\/td><td>Marketing<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The row #3 in the <code>employees<\/code> table does not match with any rows in the <code>departments<\/code> table. The <code>LEFT JOIN<\/code> clause fills in <code>NULL<\/code> for columns of the row in the <code>departments<\/code> table and combine with the row in the <code>employees<\/code> table to create the following intermediate row:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>employee_id<\/th><th>name<\/th><th>department_id<\/th><th>department_id<\/th><th>department_name<\/th><\/tr><\/thead><tbody><tr><td>3<\/td><td>Maria<\/td><td>NULL<\/td><td>NULL<\/td><td>NULL<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>After matching all rows from both tables, the <code>LEFT JOIN<\/code> clause returns the following intermediate result set :<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>employee_id<\/th><th>name<\/th><th>department_id<\/th><th>department_id<\/th><th>department_name<\/th><\/tr><\/thead><tbody><tr><td>1<\/td><td>Jane<\/td><td>1<\/td><td>1<\/td><td>Sales<\/td><\/tr><tr><td>2<\/td><td>Bob<\/td><td>2<\/td><td>2<\/td><td>Marketing<\/td><\/tr><tr><td>3<\/td><td>Maria<\/td><td>NULL<\/td><td>NULL<\/td><td>NULL<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The <code>SELECT<\/code> clause includes the <code>employee_id<\/code>, <code>name<\/code>, and <code>department_name<\/code> in the final result set:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>employee_id<\/th><th>name<\/th><th>department_name<\/th><\/tr><\/thead><tbody><tr><td>1<\/td><td>Jane<\/td><td>Sales<\/td><\/tr><tr><td>2<\/td><td>Bob<\/td><td>Marketing<\/td><\/tr><tr><td>3<\/td><td>Maria<\/td><td>NULL<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id='using-table-aliases'>Using Table Aliases <a href=\"#using-table-aliases\" class=\"anchor\" id=\"using-table-aliases\" title=\"Anchor for Using Table Aliases\">#<\/a><\/h2>\n\n\n\n<p>To make the query more concise, you can use <a href=\"https:\/\/www.sqltutorial.org\/sql-inner-join\/#using-table-aliases\">table aliases<\/a> when joining the <code>employees<\/code> and <code>departments<\/code> tables:<\/p>\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  employee_id,\n  <span class=\"hljs-keyword\">name<\/span>,\n  department_name\n<span class=\"hljs-keyword\">FROM<\/span>\n  employees e\n  <span class=\"hljs-keyword\">LEFT<\/span> <span class=\"hljs-keyword\">JOIN<\/span> departments d <span class=\"hljs-keyword\">ON<\/span> d.department_id = e.department_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><a href=\"https:\/\/www.sqltutorial.org\/playground\/?db=join&amp;q=U0VMRUNUIGVtcGxveWVlX2lkLCBuYW1lLCBkZXBhcnRtZW50X25hbWUgRlJPTSBlbXBsb3llZXMgZSBMRUZUIEpPSU4gZGVwYXJ0bWVudHMgZCBPTiBkLmRlcGFydG1lbnRfaWQgPSBlLmRlcGFydG1lbnRfaWQ7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\"> employee_id | name  | department_name\n-------------+-------+-----------------\n           1 | Jane  | Sales\n           2 | Bob   | Marketing\n           3 | Maria | NULL<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this example, we assign the table alias <code>e<\/code> to the <code>employees<\/code> table and <code>d<\/code> to the <code>departments<\/code> table and references the department_id columns from both table using these aliases.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='finding-non-matching-rows-in-other-tables'>Finding non-matching rows in other tables <a href=\"#finding-non-matching-rows-in-other-tables\" class=\"anchor\" id=\"finding-non-matching-rows-in-other-tables\" title=\"Anchor for Finding non-matching rows in other tables\">#<\/a><\/h2>\n\n\n\n<p>Besides merging rows from two tables, you can use the <code>LEFT JOIN<\/code> clause to find rows in one table that do not have corresponding rows in other tables.<\/p>\n\n\n\n<p>For example, the following query uses a <code>LEFT JOIN<\/code> clause to find the employees that do not belong to any departments:<\/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  employee_id,\n  <span class=\"hljs-keyword\">name<\/span>,\n  department_name\n<span class=\"hljs-keyword\">FROM<\/span>\n  employees e\n  <span class=\"hljs-keyword\">LEFT<\/span> <span class=\"hljs-keyword\">JOIN<\/span> departments d <span class=\"hljs-keyword\">ON<\/span> d.department_id = e.department_id\n<span class=\"hljs-keyword\">WHERE<\/span>\n  department_name <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-literal\">NULL<\/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<p><a href=\"https:\/\/www.sqltutorial.org\/playground\/?db=join&amp;q=U0VMRUNUIGVtcGxveWVlX2lkLCBuYW1lLCBkZXBhcnRtZW50X25hbWUgRlJPTSBlbXBsb3llZXMgZSBMRUZUIEpPSU4gZGVwYXJ0bWVudHMgZCBPTiBkLmRlcGFydG1lbnRfaWQgPSBlLmRlcGFydG1lbnRfaWQgV0hFUkUgZGVwYXJ0bWVudF9uYW1lIElTIE5VTEw7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\"> employee_id | name  | department_name\n-------------+-------+-----------------\n           3 | Maria | NULL<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='practical-sql-left-join-clause-example'>Practical SQL LEFT JOIN clause example <a href=\"#practical-sql-left-join-clause-example\" class=\"anchor\" id=\"practical-sql-left-join-clause-example\" title=\"Anchor for Practical SQL LEFT JOIN clause example\">#<\/a><\/h2>\n\n\n\n<p>Let&#8217;s look at the <code>countries<\/code> and <code>locations<\/code> tables from the <a href=\"https:\/\/www.sqltutorial.org\/sql-sample-database\/\">HR sample database<\/a>:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"450\" height=\"183\" src=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2016\/03\/countries_locations_tables.png\" alt=\"SQL LEFT JOIN - Joining two tables\" class=\"wp-image-253\" srcset=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2016\/03\/countries_locations_tables.png 450w, https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2016\/03\/countries_locations_tables-300x122.png 300w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/figure>\n\n\n\n<p>The <code>countries<\/code> table stores the country information and the <code>locations<\/code> table stores location data.<\/p>\n\n\n\n<p>The <code>locations<\/code> table has a <code>country_id<\/code> foreign key column that references the <code>country_id<\/code> primary key column of the <code>countries<\/code> table.<\/p>\n\n\n\n<p>Each country can have zero or more locations and each location belongs to one and only one country.<\/p>\n\n\n\n<p>The following query uses a <code>LEFT JOIN<\/code> clause to select the street_address, city, and country name from the <code>countries<\/code> and <code>locations<\/code> table for the countries USA, UK, and China:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" 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  street_address,\n  city,\n  country_name\n<span class=\"hljs-keyword\">FROM<\/span>\n  countries c\n  <span class=\"hljs-keyword\">LEFT<\/span> <span class=\"hljs-keyword\">JOIN<\/span> locations l <span class=\"hljs-keyword\">ON<\/span> l.country_id = c.country_id\n<span class=\"hljs-keyword\">WHERE<\/span>\n  c.country_id <span class=\"hljs-keyword\">IN<\/span> (<span class=\"hljs-string\">'US'<\/span>, <span class=\"hljs-string\">'UK'<\/span>, <span class=\"hljs-string\">'CN'<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><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><a href=\"https:\/\/www.sqltutorial.org\/playground\/?q=U0VMRUNUIGMuY291bnRyeV9uYW1lLCBjLmNvdW50cnlfaWQsIGwuY291bnRyeV9pZCwgbC5zdHJlZXRfYWRkcmVzcywgbC5jaXR5IEZST00gY291bnRyaWVzIGMgTEVGVCBKT0lOIGxvY2F0aW9ucyBsIE9OIGwuY291bnRyeV9pZCA9IGMuY291bnRyeV9pZCBXSEVSRSBjLmNvdW50cnlfaWQgSU4gKCdVUycsICdVSycsICdDTicp\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">              street_address              |        city         |       country_name\n------------------------------------------+---------------------+--------------------------\n 2014 Jabberwocky Rd                      | Southlake           | United States of America\n 2011 Interiors Blvd                      | South San Francisco | United States of America\n 2004 Charade Rd                          | Seattle             | United States of America\n 8204 Arthur St                           | London              | United Kingdom\n Magdalen Centre, The Oxford Science Park | Oxford              | United Kingdom\n NULL                                     | NULL                | China<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The output indicates that China has no location in the <code>locations<\/code> table.<\/p>\n\n\n\n<p>The following query finds the countries that do not have any locations in the <code>locations<\/code> table:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" 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  country_name\n<span class=\"hljs-keyword\">FROM<\/span>\n  countries c\n  <span class=\"hljs-keyword\">LEFT<\/span> <span class=\"hljs-keyword\">JOIN<\/span> locations l <span class=\"hljs-keyword\">ON<\/span> l.country_id = c.country_id\n<span class=\"hljs-keyword\">WHERE<\/span>\n  l.location_id <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-literal\">NULL<\/span>\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\n  country_name;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><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><a href=\"https:\/\/www.sqltutorial.org\/playground\/?q=U0VMRUNUIGNvdW50cnlfbmFtZSBGUk9NIGNvdW50cmllcyBjIExFRlQgSk9JTiBsb2NhdGlvbnMgbCBPTiBsLmNvdW50cnlfaWQgPSBjLmNvdW50cnlfaWQgV0hFUkUgbC5sb2NhdGlvbl9pZCBJUyBOVUxMIE9SREVSIEJZIGNvdW50cnlfbmFtZTs%3D\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\"> country_name\n--------------\n Argentina\n Australia\n Belgium\n Brazil\n China\n Denmark\n Egypt\n France\n HongKong\n India\n Israel\n Italy\n Japan\n Kuwait\n Mexico\n Netherlands\n Nigeria\n Singapore\n Switzerland\n Zambia\n Zimbabwe<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='joining-three-tables-using-a-left-join-clause'>Joining three tables using a LEFT JOIN clause <a href=\"#joining-three-tables-using-a-left-join-clause\" class=\"anchor\" id=\"joining-three-tables-using-a-left-join-clause\" title=\"Anchor for Joining three tables using a LEFT JOIN clause\">#<\/a><\/h2>\n\n\n\n<p>Here&#8217;s the database diagram that shows three tables: <code>regions<\/code>, <code>countries<\/code>, and <code>locations<\/code> from the <a href=\"https:\/\/www.sqltutorial.org\/sql-sample-database\/\">HR sample database<\/a>:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"708\" height=\"194\" src=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2016\/03\/location_tables.png\" alt=\"SQL LEFT JOIN - Joining three tables\" class=\"wp-image-258\" srcset=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2016\/03\/location_tables.png 708w, https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2016\/03\/location_tables-300x82.png 300w\" sizes=\"auto, (max-width: 708px) 100vw, 708px\" \/><\/figure>\n\n\n\n<p>The following query retrieves data from the three tables using two <code>LEFT JOIN<\/code> clauses:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" 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  region_name,\n  country_name,\n  street_address,\n  city\n<span class=\"hljs-keyword\">FROM<\/span>\n  regions r\n  <span class=\"hljs-keyword\">LEFT<\/span> <span class=\"hljs-keyword\">JOIN<\/span> countries c <span class=\"hljs-keyword\">ON<\/span> c.region_id = r.region_id\n  <span class=\"hljs-keyword\">LEFT<\/span> <span class=\"hljs-keyword\">JOIN<\/span> locations l <span class=\"hljs-keyword\">ON<\/span> l.country_id = c.country_id\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\n  region_name;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><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><a href=\"https:\/\/www.sqltutorial.org\/playground\/?q=U0VMRUNUIHJlZ2lvbl9uYW1lLCBjb3VudHJ5X25hbWUsIHN0cmVldF9hZGRyZXNzLCBjaXR5IEZST00gcmVnaW9ucyByIExFRlQgSk9JTiBjb3VudHJpZXMgYyBPTiBjLnJlZ2lvbl9pZCA9IHIucmVnaW9uX2lkIExFRlQgSk9JTiBsb2NhdGlvbnMgbCBPTiBsLmNvdW50cnlfaWQgPSBjLmNvdW50cnlfaWQgT1JERVIgQlkgcmVnaW9uX25hbWU7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">      region_name       |       country_name       |              street_address              |        city\n------------------------+--------------------------+------------------------------------------+---------------------\n Americas               | United States of America | 2011 Interiors Blvd                      | South San Francisco\n Americas               | United States of America | 2014 Jabberwocky Rd                      | Southlake\n Americas               | Mexico                   | NULL                                     | NULL\n Americas               | Canada                   | 147 Spadina Ave                          | Toronto\n Americas               | Brazil                   | NULL                                     | NULL\n Americas               | United States of America | 2004 Charade Rd                          | Seattle\n Americas               | Argentina                | NULL                                     | NULL\n Asia                   | Australia                | NULL                                     | NULL\n...<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use a <code>LEFT JOIN<\/code> clause to merge rows from two tables. The <code>LEFT JOIN<\/code> clause always includes rows from the first table (or left table) in the result set.<\/li>\n\n\n\n<li>Use a <code>LEFT JOIN<\/code> clause and a <code>WHERE<\/code> clause with the <code>IS NULL<\/code> condition to find unmatching rows in the left table.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id='quiz'>Quiz <a href=\"#quiz\" class=\"anchor\" id=\"quiz\" title=\"Anchor for Quiz\">#<\/a><\/h2>\n\n\n\n<iframe loading=\"lazy\"\n  name=\"quiz\"\n  src=\"\/quiz\/?quiz=left-join\"\n  height=\"700\"\n  width=\"600\"\n  class=\"iframe\"\n><\/iframe>\n\n\n\n<h2 class=\"wp-block-heading\" id='databases'>Databases <a href=\"#databases\" class=\"anchor\" id=\"databases\" title=\"Anchor for Databases\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-left-join\/\" target=\"_blank\" rel=\"noreferrer noopener\">PostgreSQL Left Join<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-left-join\/\" target=\"_blank\" rel=\"noreferrer noopener\">Oracle Left Join<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-left-join\/\" target=\"_blank\" rel=\"noreferrer noopener\">SQL Server Left Join<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-left-join\/\" target=\"_blank\" rel=\"noreferrer noopener\">MySQL Left Join<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.sqlitetutorial.net\/sqlite-left-join\/\" target=\"_blank\" rel=\"noreferrer noopener\">SQLite Left Join<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.db2tutorial.com\/db2-basics\/db2-left-join\/\" target=\"_blank\" rel=\"noreferrer noopener\">Db2 Left Join<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.mariadbtutorial.com\/mariadb-basics\/mariadb-left-join\/\" target=\"_blank\" rel=\"noreferrer noopener\">MariaDB Left Join<\/a><\/li>\n<\/ul>\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=\"248\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqltutorial.org\/sql-left-join\/\"\n\t\t\t\tdata-post-title=\"SQL 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=\"248\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqltutorial.org\/sql-left-join\/\"\n\t\t\t\tdata-post-title=\"SQL 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>Summary: in this tutorial, you&#8217;ll learn how to use the SQL LEFT JOIN clause to merge rows from two tables. Introduction to SQL LEFT JOIN clause # The LEFT JOIN clause is an optional clause of the SELECT statement. The LEFT JOIN clause allows you to merge rows from two tables. Here&#8217;s the syntax of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":17,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-248","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SQL LEFT JOIN<\/title>\n<meta name=\"description\" content=\"In this tutorial, you&#039;ll learn how to effectively use the SQL LEFT JOIN clause to merge rows from two or more 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.sqltutorial.org\/sql-left-join\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL LEFT JOIN\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, you&#039;ll learn how to effectively use the SQL LEFT JOIN clause to merge rows from two or more tables.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqltutorial.org\/sql-left-join\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-10T01:23:24+00:00\" \/>\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=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqltutorial.org\/sql-left-join\/\",\"url\":\"https:\/\/www.sqltutorial.org\/sql-left-join\/\",\"name\":\"SQL LEFT JOIN\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqltutorial.org\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.sqltutorial.org\/sql-left-join\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.sqltutorial.org\/sql-left-join\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2025\/02\/x-table.svg\",\"datePublished\":\"2016-03-26T02:34:12+00:00\",\"dateModified\":\"2025-02-10T01:23:24+00:00\",\"description\":\"In this tutorial, you'll learn how to effectively use the SQL LEFT JOIN clause to merge rows from two or more tables.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.sqltutorial.org\/sql-left-join\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqltutorial.org\/sql-left-join\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqltutorial.org\/sql-left-join\/#primaryimage\",\"url\":\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2025\/02\/x-table.svg\",\"contentUrl\":\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2025\/02\/x-table.svg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqltutorial.org\/sql-left-join\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqltutorial.org\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL LEFT JOIN\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqltutorial.org\/#website\",\"url\":\"https:\/\/www.sqltutorial.org\/\",\"name\":\"SQL Tutorial\",\"description\":\"An Interactive SQL Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqltutorial.org\/?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 LEFT JOIN","description":"In this tutorial, you'll learn how to effectively use the SQL LEFT JOIN clause to merge rows from two or more 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.sqltutorial.org\/sql-left-join\/","og_locale":"en_US","og_type":"article","og_title":"SQL LEFT JOIN","og_description":"In this tutorial, you'll learn how to effectively use the SQL LEFT JOIN clause to merge rows from two or more tables.","og_url":"https:\/\/www.sqltutorial.org\/sql-left-join\/","og_site_name":"SQL Tutorial","article_modified_time":"2025-02-10T01:23:24+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqltutorial.org\/sql-left-join\/","url":"https:\/\/www.sqltutorial.org\/sql-left-join\/","name":"SQL LEFT JOIN","isPartOf":{"@id":"https:\/\/www.sqltutorial.org\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sqltutorial.org\/sql-left-join\/#primaryimage"},"image":{"@id":"https:\/\/www.sqltutorial.org\/sql-left-join\/#primaryimage"},"thumbnailUrl":"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2025\/02\/x-table.svg","datePublished":"2016-03-26T02:34:12+00:00","dateModified":"2025-02-10T01:23:24+00:00","description":"In this tutorial, you'll learn how to effectively use the SQL LEFT JOIN clause to merge rows from two or more tables.","breadcrumb":{"@id":"https:\/\/www.sqltutorial.org\/sql-left-join\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqltutorial.org\/sql-left-join\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqltutorial.org\/sql-left-join\/#primaryimage","url":"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2025\/02\/x-table.svg","contentUrl":"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2025\/02\/x-table.svg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqltutorial.org\/sql-left-join\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqltutorial.org\/"},{"@type":"ListItem","position":2,"name":"SQL LEFT JOIN"}]},{"@type":"WebSite","@id":"https:\/\/www.sqltutorial.org\/#website","url":"https:\/\/www.sqltutorial.org\/","name":"SQL Tutorial","description":"An Interactive SQL Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqltutorial.org\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/pages\/248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/comments?post=248"}],"version-history":[{"count":0,"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/pages\/248\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/media?parent=248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}