SQL LEFT JOIN — Keep All Left Rows

LEFT JOIN keeps all rows from the left table and joins matching rows from the right; unmatched right columns become NULL. RIGHT JOIN is only supported in SQLite 3.39+.

Open the interactive DevRef Hub tool →

Key facts

SyntaxSELECT u.name, o.total FROM users u LEFT JOIN orders o ON o.user_id = u.id;
No matchRight columns become NULL
Standard formLEFT OUTER JOIN
RIGHT JOINSQLite 3.39+ only

Frequently asked questions

What does LEFT JOIN do?

It keeps every left-table row, with NULLs where the right has no match.

Is LEFT JOIN the same as LEFT OUTER JOIN?

Yes; OUTER is optional and they are equivalent.

Related pages

SQL LEFT JOIN is part of DevRef Hub on GOAT Lab — a free reference you can use without signing up, and it works offline. Open the tool above for any custom value.

Advertise

Part of GOAT Lab — 26 free, browser-based science, engineering and developer tools. No sign-up.