Download SQL Users` Manual - ALTIBASE Customer Support

Transcript
UNION
UNION
Syntax
SELECT statement1 UNION SELECT statement2
Description
To select all distinct rows selected by either query.
Therefore, if the results are duplicated, only one row will be displayed.
Examples
<Query> Retrieve employees and customers whose birthdays are before June 30th. (In case the
result is duplicated, only one will be displayed.)
iSQL> SELECT COUNT(*) Num_birth
FROM employee
WHERE birth < BYTE'0630'
UNION
SELECT COUNT(*)
FROM customer
WHERE birth < BYTE'0630';
NUM_BIRTH
----------------------7
8
2 rows selected.
SQL Users’ Manual
309