By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,321 Members | 1,950 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,321 IT Pros & Developers. It's quick & easy.

A query to simulate a merge of multiple tables

P: 4
In my work, very often I come across the scenario that the service team keep their information per month in seperate tables. Some time, the same month in 2 tables, some time one table per month. As for the table structures, there are some changes as well, for some months new columns will be added etc. In all table, there is a column "ID" that contain unique number for each row.

However, most of my analysis would need data from the columns that are common to all tables.

I'm trying to find ways to write query that pull records from those multiple tables without having to actually append them into a large gigantic table.

Would appreciate if someone can shed some light for me.

Thanks,
NS3687
Oct 5 '06 #1
Share this Question
Share on Google+
1 Reply


PEB
Expert 100+
P: 1,418
PEB
Hi,

You can use UNION Query

Like this one:

SELECT F1,f2, f3 FROM Table1

UNION

SELECT F1,f2, f3 FROM Table2

UNION

SELECT F1,f2, f3 FROM Table3;

And so you use the information from 3 tables!

:)
Oct 8 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.