From b3a4f91fe43fa66d08d554c9f9e12f620677cb24 Mon Sep 17 00:00:00 2001 From: Colas Geier Date: Tue, 21 Jul 2026 11:33:47 +0200 Subject: [PATCH] =?UTF-8?q?r=C3=A9solution=20des=20erreurs=20pr=C3=A9sente?= =?UTF-8?q?=20dans=20la=20synthese?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 5_GEONATURE/check_data.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/5_GEONATURE/check_data.py b/5_GEONATURE/check_data.py index b158462..7d1f483 100644 --- a/5_GEONATURE/check_data.py +++ b/5_GEONATURE/check_data.py @@ -127,7 +127,29 @@ def resolve_missing_data(con): def resolve_synthese_errors(con): sql = ''' - + with t1 as ( + SELECT + --tro.*,too.* + tro.unique_id_sinp_grp + FROM pr_occtax.t_occurrences_occtax AS too + JOIN pr_occtax.t_releves_occtax tro using (id_releve_occtax) + ),t2 as ( + select + s.id_synthese, + too.id_releve_occtax, + too.id_occurrence_occtax, + too.id_nomenclature_exist_proof + FROM pr_occtax.t_occurrences_occtax AS too + JOIN pr_occtax.t_releves_occtax tro using (id_releve_occtax) + JOIN pr_occtax.cor_counting_occtax cco using (id_occurrence_occtax) + JOIN gn_synthese.synthese s on s.unique_id_sinp = cco.unique_id_sinp_occtax + WHERE tro.unique_id_sinp_grp IN (SELECT t1.unique_id_sinp_grp FROM t1) + AND (too.nom_cite != s.nom_cite) + ) + UPDATE pr_occtax.t_occurrences_occtax too + SET id_nomenclature_exist_proof = t2.id_nomenclature_exist_proof + FROM t2 + WHERE too.id_occurrence_occtax = t2.id_occurrence_occtax; ''' if __name__ == '__main__':