Search notes:

Oracle SQL: UNION

union is a set operator.
The following two select statements are equivalent
select * from X UNION
select * from Y;

select distinct *
from (
   select * from X union all
   select * from Y
);

Simple test

Test data:
create table tq84_tab_1 (id integer, txt varchar(10));
create table tq84_tab_2 (id integer, txt varchar(10)); 

begin
   insert into tq84_tab_1 values (4, 'four' );
   insert into tq84_tab_1 values (2, 'two'  );
   insert into tq84_tab_1 values (5, 'five' );
   insert into tq84_tab_1 values (2, 'two'  );
   insert into tq84_tab_1 values (5, 'five' );

   insert into tq84_tab_2 values (5, 'five' );
   insert into tq84_tab_2 values (4, 'four' );
   insert into tq84_tab_2 values (3, 'three');
end;
/
This select statement returns 4 records:
select * from tq84_tab_1 union
select * from tq84_tab_2; 
Cleaning up:
drop table tq84_tab_1;
drop table tq84_tab_2; 

See also

union all
The plan operation UNION ALL.
Set operators
ORA-01789: query block has incorrect number of result columns

Index