PostgreSQL - Set Operations and Advanced Queries
Given two tables:
id | value
1 | 'apple'
2 | 'banana'
id | value
2 | 'banana'
3 | 'cherry'
What is the result of this query?
Table A:id | value
1 | 'apple'
2 | 'banana'
Table B:id | value
2 | 'banana'
3 | 'cherry'
What is the result of this query?
SELECT value FROM A UNION SELECT value FROM B ORDER BY value;
