Combining results from two tables that share the same data structure

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?
Who is Participating?
Note also that if you are using MySQL 5.0, you can declare a VIEW that will combine the data from the two tables into a signle logical representation.
(select * from A)
(select * from B)
ORDER BY status;
cabrera48Author Commented:
Great !!!

That works !

Thank you !
Good deal - thanks for the points!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.