-- 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 = 636
and coregistration_champ = 6
and coregistration_eligible = 1
and trim(coregistration_valeur) not in (
'06100', '06110', '06130', '06140', '06150', '06190', '06210', '06220', '06230', '06240', '06250', '06260', '13006', '13007', '13008', '13009', '13010', '13011', '13012', '13013', '13014', '13015', '13016', '13090', '13100', '31000', '31100', '31110', '33000', '33100', '33110', '33112', '33113', '33114', '33120', '33121', '33123', '33124', '34000', '34070', '34080', '34090', '34110', '34120', '34130', '34140', '44000', '44100', '44110', '44115', '44116', '44117', '44118', '44119', '44120', '44130', '59000', '59001', '59002', '59003', '59004', '59005', '59006', '59007', '59008', '59009', '59010', '59011', '59012', '59013', '59014', '59015', '59016', '59017', '59018', '59019', '59020', '59021', '59022', '59023', '59024', '59025', '59026', '59027', '59028', '59029', '59030', '59031', '59032', '59033', '59034', '59035', '59036', '59037', '59039', '59040', '59041', '59042', '59043', '59044', '59045', '59046', '59047', '59048', '59049', '59100', '59110', '59111', '59112', '59113', '67000', '67100', '67110', '67112', '67113', '67114', '67115', '67116', '67117', '69001', '69002', '69003', '69004', '69005', '69006', '69007', '69008', '69009', '69100', '69110', '69115', '69120', '69124', '69126', '69130', '69140', '69150', '69160', '69170', '75001', '75002', '75003', '75004', '75005', '75006', '75007', '75008', '75009', '75010', '75011', '75012', '75013', '75014', '75015', '75016', '75017', '75018', '75019', '75020', '75116', '92000', '92100', '92110', '92120', '92130', '92140', '92150', '92160', '92170', '92190', '92200', '92210', '92220', '92230', '92240', '92250', '92260', '92270', '92290', '92300', '92310', '92320', '92330', '92340', '92350', '92360', '92370', '92380', '92390', '92400', '92410', '92420', '92430', '92500', '92600', '92700', '92800', '93000', '93100', '93110', '93120', '93130', '93140', '93150', '93160', '93170', '93190', '93200', '93210', '93220', '93230', '93240', '93250', '93260', '93270', '93290', '93300', '93310', '93320', '93330', '93340', '93350', '93360', '93370', '93380', '93390', '93400', '93410', '93420', '93430', '93440', '93450', '93460', '93470', '93500', '93600', '93700', '93800', '94000', '94100', '94110', '94120', '94130', '94140', '94150', '94160', '94170', '94190', '94200', '94210', '94220', '94230', '94240', '94250', '94260', '94270', '94290', '94300', '94310', '94320', '94340', '94350', '94360', '94370', '94380', '94390', '94400', '94410', '94420', '94430', '94440', '94450', '94460', '94470', '94480', '94490', '94500', '94510', '94520', '94550', '94600', '94700', '94800', '94880'
);

-- 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 = 636
and coregistration_champ = 6
and coregistration_eligible = 1
and trim(coregistration_valeur) not in (
'06100', '06110', '06130', '06140', '06150', '06190', '06210', '06220', '06230', '06240', '06250', '06260', '13006', '13007', '13008', '13009', '13010', '13011', '13012', '13013', '13014', '13015', '13016', '13090', '13100', '31000', '31100', '31110', '33000', '33100', '33110', '33112', '33113', '33114', '33120', '33121', '33123', '33124', '34000', '34070', '34080', '34090', '34110', '34120', '34130', '34140', '44000', '44100', '44110', '44115', '44116', '44117', '44118', '44119', '44120', '44130', '59000', '59001', '59002', '59003', '59004', '59005', '59006', '59007', '59008', '59009', '59010', '59011', '59012', '59013', '59014', '59015', '59016', '59017', '59018', '59019', '59020', '59021', '59022', '59023', '59024', '59025', '59026', '59027', '59028', '59029', '59030', '59031', '59032', '59033', '59034', '59035', '59036', '59037', '59039', '59040', '59041', '59042', '59043', '59044', '59045', '59046', '59047', '59048', '59049', '59100', '59110', '59111', '59112', '59113', '67000', '67100', '67110', '67112', '67113', '67114', '67115', '67116', '67117', '69001', '69002', '69003', '69004', '69005', '69006', '69007', '69008', '69009', '69100', '69110', '69115', '69120', '69124', '69126', '69130', '69140', '69150', '69160', '69170', '75001', '75002', '75003', '75004', '75005', '75006', '75007', '75008', '75009', '75010', '75011', '75012', '75013', '75014', '75015', '75016', '75017', '75018', '75019', '75020', '75116', '92000', '92100', '92110', '92120', '92130', '92140', '92150', '92160', '92170', '92190', '92200', '92210', '92220', '92230', '92240', '92250', '92260', '92270', '92290', '92300', '92310', '92320', '92330', '92340', '92350', '92360', '92370', '92380', '92390', '92400', '92410', '92420', '92430', '92500', '92600', '92700', '92800', '93000', '93100', '93110', '93120', '93130', '93140', '93150', '93160', '93170', '93190', '93200', '93210', '93220', '93230', '93240', '93250', '93260', '93270', '93290', '93300', '93310', '93320', '93330', '93340', '93350', '93360', '93370', '93380', '93390', '93400', '93410', '93420', '93430', '93440', '93450', '93460', '93470', '93500', '93600', '93700', '93800', '94000', '94100', '94110', '94120', '94130', '94140', '94150', '94160', '94170', '94190', '94200', '94210', '94220', '94230', '94240', '94250', '94260', '94270', '94290', '94300', '94310', '94320', '94340', '94350', '94360', '94370', '94380', '94390', '94400', '94410', '94420', '94430', '94440', '94450', '94460', '94470', '94480', '94490', '94500', '94510', '94520', '94550', '94600', '94700', '94800', '94880'
)
);
-- fin requete cp

