How many rows does this return?
SELECT 1 UNION SELECT 1 UNION ALL SELECT 1;
- 0
- 3
- 1
- 2
Set operators run left to right:
Play SQL & Databases ▸
1 UNION 1 dedupes to one row, then UNION ALL appends another 1.