|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi
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.. Mike |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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 Thanks Mike |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Two Inner Joins |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|