Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query 2 identical tables question 1

Status
Not open for further replies.

JohnBeals

Programmer
Feb 26, 2002
49
US
I have two tables that are identical. One holds current data and one holds historical data. When we're finished with a record we move it to the historical table. This is a new process to speed up the application.

I need to query both tables for reports. I'm drawing a blank on this. I know I can create a new temporary table and copy the data from both tables into the new one and query that table, but that sounds like it would take longer than querying both tables in one query.

Any suggestions? Some sort of Join?

Thanks,
JB
 
Try this:

select <columns> from table1

Union

select <columns> from table2


That will get you everything you need.

Good Luck
 
That's it! Thanks!
The folks on this site have saved my bacon on multiple occasions. I spent 2 hours looking through my SQL 7 books without finding the answer to this question. I got it here in 5 minutes!!!

Thanks again!
John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top