Union select adding multiple records

B

Bob

How can I add multiple records using the union select statement only once?

For example:

Select car, type
From
Cars
Union select
"mycar1", "mytype1" <--- this should be the first record added
"mycar2", "mytype2" <--- this should be the second record added
From
Cars

Obviously the statement above does not work.... somehow I need to indicate
where the second record starts... I suppose there is a solution without
using the union statement for every record...
 
K

Kirk P.

Your SQL statement Select car, type FROM Cars will give you a list of cars
and types WITHOUT the use of a UNION. The UNION would come into play if you
wanted to combine the information in two different tables that contain
similar information, such as joining a Cars table and a Trucks table.
 
J

John Vinson

How can I add multiple records using the union select statement only once?

For example:

Select car, type
From
Cars
Union select
"mycar1", "mytype1" <--- this should be the first record added
"mycar2", "mytype2" <--- this should be the second record added
From
Cars

Obviously the statement above does not work.... somehow I need to indicate
where the second record starts... I suppose there is a solution without
using the union statement for every record...

What are you trying to accomplish here?? A UNION query doesn't add
records to anything; in fact it's not updateable by definition. You
can base an Append query upon a Union query but that would not seem to
make sense in this context.


John W. Vinson[MVP]
 
Top