operator
UNION
Combines result sets and eliminates duplicate rows. Both queries must return compatible columns. Example target: PostgreSQL 17 and SQLite (local fixture tested).
Formal Syntax & Structure
sql syntaxsql
query UNION queryWorking Example
Example Snippetsql
SELECT 1 UNION SELECT 1 ORDER BY 1;