-- requete sur cp
insert into coregistration.export_auto_non_eligible (export_auto_non_eligible_affichage)
select coregistration_coregistration_affichage
from coregistration
where coregistration_campagne_annonceur = 743
and coregistration_champ = 6
and coregistration_eligible = 1
and substring(coregistration_valeur from 1 for 2) not in ('13', '26', '31', '38', '69', '77', '74', '78', '75', '91', '92', '93', '94', '95', '01', '74', '26', '07', '34', '84');

-- on passe les lignes traitees a exportable 3 pour ne plus les selectionner
update coregistration set coregistration_eligible = 3
where coregistration_coregistration_affichage in
(
select coregistration_coregistration_affichage
from coregistration
where coregistration_campagne_annonceur = 743
and coregistration_champ = 6
and coregistration_eligible = 1
and substring(coregistration_valeur from 1 for 2) not in ('13', '26', '31', '38', '69', '77', '74', '78', '75', '91', '92', '93', '94', '95', '01', '74', '26', '07', '34', '84');
);
-- fin requete cp

