The UNION statement works by combining the results of two or more queries:
Code:
SELECT col1, col2, ...
FROM ...
UNION
SELECT col3, col4, ...
FROM ...
Getting the queries to refer to tables in different databases may be problematic, depending on your RDMS. In SQL Server it's pretty easy if the two databases are on the same server; in that case the table names are given in the format <database.owner.tablename>, etc.
Jeff Mason
Custom Apps, Inc.
www.custom-apps.com