Combining results from two tables that share the same data structure
Posted on 2006-04-02
Suppose you have two tables: A and B. Both tables have the same columns: col1, col2, col3, etc.
So my records are distributed in two different tables that have the same format. I know, this is not good normalization design, but that is the way they are setup right now.
The question is: how do I query both in a single sql statement, combine the results of the query get all the records from both, and list the result in alphabetical order?
I can do:
select * from A ORDER BY status;
and I can also run:
select * from B ORDER BY status;
But how do I run both at the same time and get a single output from them?