-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add candidates that are not followed by ft
- Loading branch information
laurinehu
committed
Apr 19, 2024
1 parent
b9855a7
commit 3eaf697
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
select | ||
salarie.salarie_id, | ||
sorties.date_sortie | ||
from "fluxIAE_Salarie" as salarie | ||
-- pour récupérer le nir pour ensuite pouvoir filtrer les candidats non ft | ||
left join "pass_agréments" as pass | ||
on salarie."hash_numéro_pass_iae" = pass."hash_numéro_pass_iae" | ||
left join candidats as c | ||
on c.id = pass.id_candidat | ||
-- pour filtrer les candidats non ft | ||
left join ft_candidats_nord as ft_candidates | ||
on ft_candidates.nir_hash = c.hash_nir | ||
-- ici on croise avec les contrats pour récup la sortie | ||
left join "sorties_definitives" as sorties | ||
on sorties.contrat_id_pph = salarie.salarie_id | ||
-- on ne garde que les candidats : | ||
-- - du nord | ||
-- - un pass IAE a été attribué entre le 1 janvier 2021 et le 30 juin 2023. | ||
where | ||
salarie.salarie_code_dpt = '059' | ||
and pass.date_début > '2021-01-01' | ||
and pass.date_début < '2023-06-30' | ||
and c.hash_nir is null |