-- 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 = 764
and coregistration_champ = 6
and coregistration_eligible = 1
and substring(coregistration_valeur from 1 for 2) not in ('01', '07', '10', '12', '13', '14', '20', '26', '27', '31', '33', '34', '35', '37', '38', '39', '40', '41', '42', '44', '45', '59', '60', '61', '62', '65', '66', '67', '69', '70', '73', '74', '75', '78', '80', '83', '84', '85');
-- 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 = 764
and coregistration_champ = 6
and coregistration_eligible = 1
and substring(coregistration_valeur from 1 for 2) not in ('01', '07', '10', '12', '13', '14', '20', '26', '27', '31', '33', '34', '35', '37', '38', '39', '40', '41', '42', '44', '45', '59', '60', '61', '62', '65', '66', '67', '69', '70', '73', '74', '75', '78', '80', '83', '84', '85')
);
-- fin requete cp

