SQL 2023 · Joins and combining queries

Find rows with no match

Return users who have never placed an order.

SELECT u.* FROM users u LEFT JOIN orders o ON o.user_id = u.id WHERE o.id IS NULL;

Official SQL 2023 documentation

More joins and combining queries commands

All joins and combining queries commands · SQL 2023 cheatsheet

Was this page helpful?