Join or Subquery?

  • Thread starter Thread starter dmeckley
  • Start date Start date
D

dmeckley

I've got two tables, a Part table and a vendor table. Both vendors and
manufacturers are in the vendor table with ID and name fields. The vendors
and manufacturers are referenced in the Part table by vendor.ID.

I'd like to view all parts in the part table with vendor ID and name and
manuf. ID and name.

I can't join both Part.vendID and Part.manufID to vend.ID without getting
ambiguous join errors and correlated subquerries seem to filter my view.

Can anyone give me an idea (short of changing the db schema) how to approach
this.

Thank in advance,

Davem
 
Try joining the Part table twice to the Vendor Table along
the lines of

SELECT P.vendId, V.[name] as vendorName, P.manufId,
M.[name] as manufacturerName, ...
FROM (Part P INNER JOIN Vendor V ON P.vendId = V.vendorId)
INNER JOIN Vendor M ON P.manufId = M.vendorId

Hope This Helps
Gerald Stanley MCSD
 

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

Access Sorting and grouping using multiple tables 0
Combo Box Question 2
Help with OUTER JOIN 2
Normalizing Vendor Names 1
trying to get a sum in access 2003 1
Subqueries 4
Access crashes on a subquery 7
crazy query 5

Back
Top