Left Outer Join

J

Jade5

Hello:
How can I make this query a Left Outer Join? I want all institution names
from the institution table and only the institutions from the History table
that have a previous name. Thanks J.
Select DistinctRow [Institution name], [Institution id], [Corporation id]
from [Institution table]
UNION Select [previous name], [Institution id], [Corporation id] from
[History table]
ORDER BY [Institution name];
 
K

Ken Snell \(MVP\)

Try this:

SELECT DistinctRow T.[Institution name], T.[Institution id],
T.[Corporation id], H.[previous name]
FROM [Institution table] AS T LEFT JOIN
[History table] AS H
ON T.[Institution id] = H.[Institution id]
ORDER BY T.[Institution name];
 
J

Jade5

That worked perfectly. Thanks for your help, Ken
Jackie.

Ken Snell (MVP) said:
Try this:

SELECT DistinctRow T.[Institution name], T.[Institution id],
T.[Corporation id], H.[previous name]
FROM [Institution table] AS T LEFT JOIN
[History table] AS H
ON T.[Institution id] = H.[Institution id]
ORDER BY T.[Institution name];

--

Ken Snell
<MS ACCESS MVP>


Jade5 said:
Hello:
How can I make this query a Left Outer Join? I want all institution names
from the institution table and only the institutions from the History
table
that have a previous name. Thanks J.
Select DistinctRow [Institution name], [Institution id], [Corporation id]
from [Institution table]
UNION Select [previous name], [Institution id], [Corporation id] from
[History table]
ORDER BY [Institution name];
 

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

Similar Threads


Top