Syntax

SQL Left Join Syntax

In SQL, left join: returns all left rows plus matches from the right — SELECT * FROM users u LEFT JOIN orders o ON o.user_id = u.id;

Quick Answer

Syntax
SELECT * FROM users u LEFT JOIN orders o ON o.user_id = u.id;
SQLSyntax

Left Join

Code example
SELECT * FROM users u LEFT JOIN orders o ON o.user_id = u.id;

Returns all left rows plus matches from the right.

Learn More

How to left join in SQL

  1. Open your SQL file or editor.
  2. Copy the example, then replace its sample names and values for your code.

SQL Left Join Syntax

Use SELECT * FROM users u LEFT JOIN orders o ON o.user_id = u.id;.

Related Syntax References

Frequently asked questions

What is the SQL syntax for left join?

Use this pattern: SELECT * FROM users u LEFT JOIN orders o ON o.user_id = u.id;

Can I copy this SQL code example?

Yes. Use Copy code and adapt the example to your program.

Is this SQL syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify