Newbie trying to figure out a Union Query

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
 
M

Michel Walsh

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
 
M

Mike Webb

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
 

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