community.borland.com

Article #25077: Example of how to use the Union operator

Problem:
A working example of how to use the union operator is not available.

Solution:
IB V4.x
IB V5.x

Here is an example of how to do this operation:

create database "a.gdb" user "sysdba" password "masterkey";
create table table1 (f1 char(5) not null, f2 char(5) not null);
create table table2 (f1 char(5) not null, f2 char(5) not null);
commit;
insert into table1 values ("1","a");
insert into table2 values ("2","b");
select * from table1 union select * from table2;

This select query will combine every record from both table1 and  table2
as the result set.  Select * can only be used with identical table structures
from both tables.  

Last Modified: 22-SEP-00