By default, the UNION keyword excludes duplicate rows.
To retain the duplicate values, add the optional keyword ALL, as the
following query shows.Figure 1: Query
SELECT stock_num, manu_code FROM stock
WHERE unit_price < 25.00
UNION ALL
SELECT stock_num, manu_code FROM items
WHERE quantity > 3
ORDER BY 2
INTO TEMP stock item;
The query uses the UNION ALL keywords to unite two SELECT
statements and adds an INTO TEMP clause after the final SELECT to
put the results into a temporary table. It returns the same rows as Query but also
includes duplicate values.Figure 2: Query result