+1-617-874-1011 (US)

  +44-117-230-1145 (UK)

SQL Left Join Homework Help

This query will return all of the records in the left table (tableX) regardless if any of those records have a match in the right table (tableY). It will also return any matching records from the right table.

tableX          tableY


left join

Syntax:

SELECT "select_list"
FROM TableX X
LEFT JOIN TableY Y
ON X.Key = Y.Key

Example Of SQL Left Join:

SELECT X.PK, X.Value,
Y.Value, Y.PK
FROM TableX X
LEFT JOIN TableY Y
ON X.PK = Y.PK

OUTPUT

left join example output

SQL Left Join Homework Help

Different type of SQL JOIN

The types of JOIN you can use and the differences between them,