merging two queries in one

  • Thread starter Thread starter Jan Coucke
  • Start date Start date
J

Jan Coucke

Hello,

Is it possible to make a new query based on two older queries with the same
2 fields? The new query schould contain those 2 fields with the information
from the first and the second query.
 
Have you rode about UNION



you can make an union of two queries



SELECT FIRSTNAME FROM CLIENTS

UNION

SELECT FIRSTNAME FROM VENDORS
 
Hello,

thx for your quick answer but it still have a problem.
after making my query with the UNION instruction it didn't show me all my
records. The query deleted all the equal records. Is there a possibility
that i can see all my records?
 
It is true UNION makes a DISTINCT query.

You can solve it like here:



SELECT FIRSTNAME,'C' FROM CLIENTS

UNION

SELECT FIRSTNAME,'V' FROM VENDORS



so as to identify the record
 
You can replace UNION with UNION ALL.

UNION returns DISTINCT records. UNION ALL returns "All" records.
 
Back
Top