Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ambiguous joins in an unmatched query?

Status
Not open for further replies.

MrsNic

Instructor
Feb 6, 2005
44
GB
I have set up a database to keep track of the specific ICT skills pupils use in their coursework. All was going well until I tried to use an unmatched query to find any skills an individual pupil has not used.


It keeps telling me I have ambiguous joins

tables used

pupil (1-m) coursework(1 -m) coursework skill(m - 1)skills

sql used

SELECT Coursework.CourseworkIDNumber, CourseworkSkills.Student, CourseworkSkills.SkillID, Skills.Description
FROM Skills LEFT JOIN (Coursework INNER JOIN CourseworkSkills ON Coursework.CourseworkIDNumber = CourseworkSkills.Student) ON Skills.SkillID = CourseworkSkills.SkillID
WHERE (((CourseworkSkills.SkillID) Is Null));

I thought it was going to be so simple!!
 
I don't think that SQL can evaluate an inner join within a left join. I think you may need to redesign your tables to allow two left joins.

Access makes all things possible. It even makes them intelligible
 
find any skills an individual pupil has not used
Perhaps something like this ?
SELECT Coursework.CourseworkIDNumber, CourseworkSkills.Student, Skills.SkillID, Skills.Description
FROM Skills, Coursework INNER JOIN CourseworkSkills ON Coursework.CourseworkIDNumber = CourseworkSkills.Student
WHERE CourseworkSkills.SkillID Not In (SELECT SkillID FROM Skills)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top