SQL 2023 · Joins and combining queries
Name a subquery with a CTE
Break a query into readable steps.
WITH recent AS (
SELECT * FROM orders WHERE created_at > CURRENT_DATE - 30
)
SELECT user_id, COUNT(*) FROM recent GROUP BY user_id;
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
- Filter with a subquery
- Stack two result sets
All joins and combining queries commands · SQL 2023 cheatsheet