I have 4 tables: Fonctionnaire, Echelon, PromotionEchelon, Mise.
Fonctionnaire: CodeFonctionnaire(PK), NomFonctionnaire, PrenomFonctionnaire
Echelon : NumEchelon(PK), CodeEchelon, Indice
PromotionEchelon:CodeFonctionnaire(FK),NumEchelon(FK),DateArrete
Mise:CodeMise(PK),Nature,NumArrete,DateArrete,DureeMise,CodeFonctionnaire(FK)
I want to select the list of all 'Fonctionnaire' and their 'DateArrete' from
'PromotionEchelon' and their 'CodeEchelon, Indice' from 'Echelon' and if
exist their 'Nature,NumArrete,DateArrete,DureeMise' from 'Mise'.
I used this query:
SELECT
Fonctionnaire.CodeFonctionnaire,
Fonctionnaire.NomFonctionnaire,
Fonctionnaire.PrenomFonctionnaire,
Echelon.CodeEchelon, Echelon.Indice,
PromotionEchelon.DateArrete,
Mise.Nature, Mise.NumArrete, Mise.DateArrete, Mise.DureeMise
FROM
Fonctionnaire, PromotionEchelon, Echelon, Mise
WHERE
Fonctionnaire.CodeFonctionnaire = PromotionEchelon.CodeFonctionnaire
AND PromotionEchelon.NumEchelon = Echelon.NumEchelon
AND Fonctionnaire.CodeFonctionnaire = Mise.CodeFonctionnaire
But it returns 0 records, i tried inner and outer join and i get errors.
So where is the error in my query?