Why does this query work, but not the other example?

G

Guest

Can someone explain why the 1st query works, but the second doesn't?

SELECT [Run_Point_Venue_A], [Run_Point_Address_A] FROM [Run_Points]
UNION SELECT [Run_Point_Venue_C], [Run_Point_Address_C]
FROM [Run_Points]

SELECT [Run_Point_Venue_A], [Run_Point_Address_A] FROM [Run_Points]
SELECT [Run_Point_Venue_B], [Run_Point_Address_B] FROM [Run_Points]
UNION SELECT [Run_Point_Venue_C], [Run_Point_Address_C]
FROM [Run_Points]





SELECT [Run_Point_Venue_C], [Run_Point_Address_C] FROM [Run_Points]
 
G

Guest

Thanks Dale, I can get my head around the theory, but it's the syntax that is
usually my undoing... do you know a good online source for syntax in queries
with examples?

Dale Fye said:
Because you forgot a UNION statment between the 1st and 2nd SELECT statements.


--
Email address is not valid.
Please reply to newsgroup only.


efandango said:
Can someone explain why the 1st query works, but the second doesn't?

SELECT [Run_Point_Venue_A], [Run_Point_Address_A] FROM [Run_Points]
UNION SELECT [Run_Point_Venue_C], [Run_Point_Address_C]
FROM [Run_Points]

SELECT [Run_Point_Venue_A], [Run_Point_Address_A] FROM [Run_Points]
SELECT [Run_Point_Venue_B], [Run_Point_Address_B] FROM [Run_Points]
UNION SELECT [Run_Point_Venue_C], [Run_Point_Address_C]
FROM [Run_Points]





SELECT [Run_Point_Venue_C], [Run_Point_Address_C] FROM [Run_Points]
 

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

Top