Union select adding multiple records

  • Thread starter Thread starter Bob
  • Start date Start date
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...
 
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.
 
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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top