Skip to content
Snippets Groups Projects
Commit 32e89579 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Merge branch 'master' of https://git.unicaen.fr/open-source/OSE

parents 9040954a c5b4ed2f
No related branches found
No related tags found
No related merge requests found
...@@ -2,14 +2,16 @@ CREATE OR REPLACE FORCE VIEW SRC_ELEMENT_TAUX_REGIMES AS ...@@ -2,14 +2,16 @@ CREATE OR REPLACE FORCE VIEW SRC_ELEMENT_TAUX_REGIMES AS
WITH apogee_query AS ( WITH apogee_query AS (
SELECT SELECT
e.z_element_pedagogique_id z_element_pedagogique_id, e.z_element_pedagogique_id z_element_pedagogique_id,
to_number(e.annee_id) + 1 annee_id, -- à partir de décembre on synchronise avec l'année en cours, avant on se réfère à l'année antérieure
to_number(e.annee_id) + CASE WHEN COALESCE(p.ecart_mois,0) > 2 THEN 0 ELSE 1 END annee_id,
e.effectif_fi effectif_fi, e.effectif_fi effectif_fi,
e.effectif_fc effectif_fc, e.effectif_fc effectif_fc,
e.effectif_fa effectif_fa, e.effectif_fa effectif_fa,
'Apogee' z_source_id, 'Apogee' z_source_id,
TO_NUMBER(e.annee_id) + 1 || '-' || e.z_element_pedagogique_id source_code TO_NUMBER(e.annee_id) + CASE WHEN COALESCE(p.ecart_mois,0) > 2 THEN 0 ELSE 1 END || '-' || e.z_element_pedagogique_id source_code
FROM FROM
ose_element_effectifs@apoprod e ose_element_effectifs@apoprod e
LEFT JOIN periode p ON p.code = OSE_DIVERS.DATE_TO_PERIODE_CODE(sysdate,TO_NUMBER(e.annee_id))
WHERE WHERE
(e.effectif_fi + e.effectif_fc + e.effectif_fa) > 0 (e.effectif_fi + e.effectif_fc + e.effectif_fa) > 0
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment