Documentation Index
Fetch the complete documentation index at: https://docs.fiquela.io/llms.txt
Use this file to discover all available pages before exploring further.
UNION and UNION ALL let you merge the results of two or more independent queries into a single result set. Both queries can target different files, different paths within the same file, or different filter conditions.
UNION vs UNION ALL
| Clause | Duplicate rows |
|---|---|
UNION | Removed (hash-based deduplication) |
UNION ALL | Kept |
Column count requirement
The number of selected columns must match across all combined queries. If they do not match, FiQueLa throws aQueryLogicException.
SELECT * skip this validation.
Basic usage
Chaining multiple unions
You can chain as many unions as needed. Each union executes its own independent pipeline.How UNION interacts with EXPLAIN
When you runEXPLAIN or EXPLAIN ANALYZE on a query that includes a union, each union branch reports its own sub-phases in the output.
Single union produces phases like:
Each union sub-query executes its own full pipeline —
FROM → WHERE → GROUP BY → SELECT → etc. Clauses like ORDER BY and LIMIT on the main query apply to the final merged result, not to individual branches.