SQL 2023 · Joins and combining queries
Filter with a subquery
Use one query's result inside another.
SELECT * FROM products WHERE price > (SELECT AVG(price) FROM products);
Official SQL 2023 documentation
More joins and combining queries commands
- Join two tables
- Keep rows without a match
- Find rows with no match
- Check that related rows exist
- Stack two result sets
- Name a subquery with a CTE
All joins and combining queries commands · SQL 2023 cheatsheet