SELECT * FROM inscription i
INNER JOIN employeGroupe ge
ON i.IDGroupe=ge.IDGroupe
INNER JOIN Employe e
ON e.IDEmploye=ge.IDEmploye
INNER JOIN cOURS BC
on bc.IDCours=i.IDCours
I have 4 tables as follows:
Inscription
EmployeeGroupe
Employee
Cours
Column IDGroupe in table Inscription relates to table EmployeeGroupe
Column IDEmploe in table EmployeeGroupe relates to table Employee
Column IDCours in table Inscription relates to table Cours
My problem is that I want to display the names of related employes to cours. We can find the cours into inscription table. Not that INscription.IDGroupe for some cours is null then I am not able to bring up the EmployeGroupe related which go up to EmployeID in Employe table.
My query is like this:
SELECT * FROM inscription i
INNER JOIN employeGroupe ge
ON i.IDGroupe=ge.IDGroupe
INNER JOIN Employe e
ON e.IDEmploye=ge.IDEmploye
INNER JOIN cOURS BC
on bc.IDCours=i.IDCours