PostgreSQL - Set Operations and Advanced Queries
You have two SELECT queries:
and
You want to get all unique IDs from both years but keep duplicates only from
SELECT id FROM orders_2021;and
SELECT id FROM orders_2022;You want to get all unique IDs from both years but keep duplicates only from
orders_2021. Which PostgreSQL set operation combination achieves this?