UNION returns unique values?

S

Stef

Quick question, is a UNION queries supposed to return unique values?

I have 2 tables, both with an [Invoice] field. When I generate an union
query between the 2 to get all the invoice #, I get a single row even if
a given invoice# is present in both tables.

I that as per SQL specification?

many thx
 
G

George Nicholson

Per Jet SQL Help:

"By default, no duplicate records are returned when you use a UNION
operation; however, you can include the ALL predicate to ensure that all
records are returned. This also makes the query run faster."

AFAIK, usage would be something like:

SELECT xxxx,yyyy,zzzz From ttttt UNION ALL
SELECT xxxx,yyyy,zzzz From sss.....

HTH,
 
Top