March 16th, 2000, 05:59 AM
Is it possible to run a query with two innerjoins on MySQL, such as
SELECT DISTINCT qualification,exambody
FROM Qualifications LEFT JOIN (ExamBodies LEFT JOIN ExamDates ON ExamBodies.ExambodyID = ExamDates.exambodyID)
ON Qualifications.QualificationID = ExamDates.qualificationID
ORDER BY qualification, exambody
The above works fine in SQL Server 7 and Access but I can't find a solution to getting the distinct examining body and qualifications from the ExamDates table.
Any help much appreciated. This query will be run very frequently so creating temperorary tables is not an option..
March 16th, 2000, 01:49 PM
Well, you haven't stated what table qualification and exambody are on as you will need to specify if either field name appears in more than one table. With that in mind, this should work:
select distinct qualification,distinct exambody from qualifictions q,exambodies eb, examdates ed where q.QualificationID = ed.qualificationID and eb.ExambodyID=ed.exambodyID order by qualification,exambody
March 16th, 2000, 02:01 PM
I'm getting a parse error near 'distinct exambody from qualifictions'
If I take out the second distinct the query will run but I then get 'The table SQLbb5_0 is full' The table Examdates had 4500 records in it and the query should return 21 distince rows. Any further clues