Union query with different amount of columns

richmoijn

New member
Local time
Today, 07:42
Joined
Jan 16, 2008
Messages
1
Hi,

I have 2 tables, one "new" and the other one called "old".

The thing is that the "new" one has more information (more columns) than the "old". So I can only do a Union query on the columns that do match, but it is possible to have the information from the columns in the "new" table added as well into that query?

Do I have to create the new columns in the "old" table before the Union query?

BR
 
You don't have to create columns in the table, but you can (have to) in the query:

SELECT Field1, Field2, Field3
FROM NewTable
UNION
SELECT Field1, Field2, "Nothing"
FROM OldTable

You can use a string, zero, or whatever is appropriate.
 

Users who are viewing this thread

Back
Top Bottom