SELECT statements that use
UNION or
UNION ALL allow you to obtain a single result table from multiple
SELECT queries.
UNION queries are suitable for combining similar information contained in more than one data source.
UNION eliminates duplicate rows.
UNION ALL preserves duplicate rows. Using the
UNION ALL option is recommended unless you require duplicate rows to be removed.
With UNION, the Pervasive PSQL Engine orders the entire result set which, for large tables, can take several minutes.
UNION ALL eliminates the need for the sort.
The Pervasive PSQL database engine does not support LONGVARBINARY columns in
UNION statements.
LONGVARCHAR is limited to 65500 bytes in
UNION statements. The operator
UNION cannot be applied to any SQL statement that references one or more views.
It is common to use the NULL scalar function to allow a
UNION select list to have a different number of entries than the parent select list. To do this, you must use the
CONVERT function to force the
NULL to the correct type.