Newbie trying to figure out a Union Query

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

I have looked frontwards and backwards through the
Northwinds sample db to find out WHAT uses the Union
Query named "Customers and Suppliers by City" - to no
avail. I believe I need a union query for a simple
database I am designing for the non-profit I work for and
want to 'dig into' this sample first.

Would someone be kind enough to point me in the right
direction?

TIA,
Mike
 
Hi,


It just merge vertically two "lists",

SELECT City, CompanyName, ContactName, "Customers" AS [Relationship]
FROM Customers

and


SELECT City, CompanyName, ContactName, "Suppliers"
FROM Suppliers



removing the duplicated records (using UNION ALL won't eliminate duplicated
values). The names of the result are those supplied in the first list. So,
it can, if required,

ORDER BY City, CompanyName


on the result.



Hoping it may help,
Vanderghast, Access MVP
 
Michel Walsh said:
Hi,


It just merge vertically two "lists",

SELECT City, CompanyName, ContactName, "Customers" AS [Relationship]
FROM Customers

and


SELECT City, CompanyName, ContactName, "Suppliers"
FROM Suppliers



removing the duplicated records (using UNION ALL won't eliminate duplicated
values). The names of the result are those supplied in the first list. So,
it can, if required,

ORDER BY City, CompanyName


on the result.



Hoping it may help,
Vanderghast, Access MVP



Mike said:
I have looked frontwards and backwards through the
Northwinds sample db to find out WHAT uses the Union
Query named "Customers and Suppliers by City" - to no
avail. I believe I need a union query for a simple
database I am designing for the non-profit I work for and
want to 'dig into' this sample first.

Would someone be kind enough to point me in the right
direction?

TIA,
Mike
 
Back
Top