Creating One Table from Many Tables

eugz

Registered User.
Local time
Today, 06:45
Joined
Aug 31, 2004
Messages
128
Hi All.
Need union three TableA, TableB and TableC into one table called TableX? All table has same column name. TableX shouldn't has dublications.
Thanks
 
First query (call it something obvious -- I'll use q_Union_Tables)

Code:
SELECT Field1, Field2, FieldX FROM TableA
UNION SELECT Field1, Field2, FieldX FROM TableB
UNION SELECT Field1, Field2, FieldX FROM TableC;


Second query (this is a make table query where we will make TableX):

Code:
SELECT DISTINCT Field1, Field2, FieldX 
INTO TableX
FROM q_Union_Tables;

The distinct will only write unique values to TableX.
 

Users who are viewing this thread

Back
Top Bottom