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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make one table from several tables

Status
Not open for further replies.

Zonie32

Technical User
Jan 13, 2004
242
US
I have 8 tables, all are the same format and same field headings, just different months.

How do I create one master table from all 8 tables?
 
Hi!

Copy one of the tables and rename it as a general table. Then run a series of update queries to transfer the information from the other tables to the general table.

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
if you can't make a new table, you can create a query to simulate:

SELECT * FROM January
UNION
SELECT * FROM February
UNION
etc...

then you can use this query to get the combined information.

HTH

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases:
The Fundamentals of Relational Database Design
Understanding SQL Joi
 
Or you may want to
Code:
Select Q.* INTO NewTable

From
  (
   SELECT 1 As MonthNumber, A.* FROM January A
   UNION ALL
   SELECT 2, A.* FROM February A
   UNION ALL
   SELECT 3, A.* FROM March A
   etc.
   ) As Q
So that you can identify the records from each table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top