union

Description

Describes the union of the two or more derived tables.

Syntax

(union
            derived_table1
            ...
             derived_tableN
)

Parameters

derived_table1...derived_tableN

is the derived tables to be united.

Returns

A derived table that is the union of the specified operands.

Examples

Example 1

select * from t1
union
select * from t2
union
select * from t3

(union
    (t_scan t1)
    (t_scan t2)
    (t_scan t3)
)

Returns the union of the three full table scans.

Example 2

select 1,2
union
select * from t2

(union
    ( )
    (tscan t2)
)

Since the first side of the union is not an optimizable query, the first union operand is empty.

Usage

See also

i_scan, scan, t_scan