Get Data using sql with multi join?

Viewed 30

I'have these tables and enter image description here

I want to get the persistence list when the typeAbsence is not null . these my criteria translated in sql:

select *
from   PERSISTENCE prestation0_ 
inner join AgentMJ agentmj1_ on prestation0_.FK_AGENTMJ_ID=agentmj1_.PK_AGENTMJ_ID
inner join Absence absences2_ on agentmj1_.PK_AGENTMJ_ID=absences2_.FK_AGENT_MJ_ID
inner join TypeAbsence typeabsenc3_ on 
absences2_.FK_TYPE_ABSENCE_ID=typeabsenc3_.PK_TYPE_ABSENCE_ID 
where agentmj1_.PK_AGENTMJ_ID=18   and typeabsenc3_.PK_TYPE_ABSENCE_ID=3 ;

any help thanks in advance

0 Answers
Related