-- SELECT * from police WHERE  libellePolice like ('%COPACI%')


-- SELECT codeGcAssureur,idPolice FROM  adherentbascule   where idPolice in (295);

SELECT b.codeGcAssureur,c.idPolice FROM  baremepriseencharge b  INNER JOIN college c ON (b.codeProduit=c.codeProduit)   WHERE idPolice IN (295);

-- SELECT codeGcAssureur,idPolice FROM  carteassuretest   where idPolice in (295);

SELECT codeGcAssureur,idPolice FROM  college   WHERE idPolice IN (295);

-- SELECT codeGcAssureur,idPolice FROM  college_ren_temp   where idPolice in (295);
-- SELECT codeGcAssureur,idPolice FROM  college_temp   where idPolice in (295);
SELECT codeGcAssureur,idPolice FROM  collegelienparente   WHERE idPolice IN (295);

-- SELECT codeGcAssureur,idPolice FROM  collegelienparente_temp   where idPolice in (295);
-- SELECT codeGcAssureur,id FROM  d_police   where id in (295);

-- SELECT codeGcAssureur,idPolice FROM  gc_carte   where idPolice in (295);
-- SELECT codeGcAssureur,idPolice FROM  gc_carte_temp_non_sel   where idPolice in (295);
-- SELECT codeGcAssureur,idPolice FROM  gc_carte_temp_sel   where idPolice in (295);

-- SELECT codeGcAssureur,idPolice FROM  gc_facturationcarte   where idPolice in (295);
-- SELECT codeGcAssureur,idPolice FROM  gc_facture   where idPolice in (295);
-- SELECT codeGcAssureur,idPolice FROM  gc_facture_temp_non_sel   where idPolice in (295);
-- SELECT codeGcAssureur,idPolice FROM  gc_facture_temp_sel   where idPolice in (295);
-- SELECT codeGcAssureur,idPolice FROM  gc_frais_gestion_temp_non_sel   where idPolice in (295);
SELECT codeGcAssureur,idPolice FROM  hpolice   WHERE idPolice IN (295);


SELECT codeGcAssureur,id FROM  police   WHERE id IN (295);

SELECT b.codeGcAssureur,c.idPolice FROM  primeproduit    b  INNER JOIN college c ON (b.codeProduit=c.codeProduit)   WHERE idPolice IN (295);

SELECT b.codeGcAssureur,c.idPolice FROM  produit  b  INNER JOIN college c ON (b.codeProduit=c.codeProduit)   WHERE idPolice IN (295);


SELECT * FROM gc_assureur ORDER BY id DESC
-- mise a jour garant


UPDATE baremepriseencharge b  INNER JOIN college c ON (b.codeProduit=c.codeProduit)   SET b.codeGcAssureur='COPACI'  WHERE idPolice IN (295);

UPDATE college SET codeGcAssureur='COPACI'  WHERE idPolice IN (295);

UPDATE collegelienparente SET codeGcAssureur='COPACI'  WHERE idPolice IN (295);

UPDATE hpolice SET codeGcAssureur='COPACI'  WHERE idPolice IN (295);

UPDATE primeproduit b  INNER JOIN college c ON (b.codeProduit=c.codeProduit)   SET b.codeGcAssureur='COPACI'  WHERE idPolice IN (295);

UPDATE produit b  INNER JOIN college c ON (b.codeProduit=c.codeProduit)   SET b.codeGcAssureur='COPACI'  WHERE idPolice IN (295);

UPDATE utilisateur_garant SET code_garant='COPACI'  WHERE idPolice IN (295); 

UPDATE police SET codeGcAssureur='COPACI'  WHERE id IN (295);


