Filtre par une info complémentaire
Où XX est l’id de l’info complémentaire que l’on souhaite interroger :
select identite_id from info_comp ic, identite_infos_comp iic where ic.info_comp_id=iic.info_comp_id and iic.supprimer=’N’ and iic.info_comp_id IN (XX) and iic.identite_id=@identite_id
Filtre par plusieurs infos complémentaires
Où XX | YY | ZZ sont les id des infos complémentaires que l’on souhaite interroger. Pas d’espace après la virgule.
select identite_id from info_comp ic, identite_infos_comp iic where ic.info_comp_id=iic.info_comp_id and iic.supprimer=’N’ and iic.info_comp_id IN (XX,YY,ZZ) and iic.identite_id=@identite_id
Filtre par département
Où XX est le numéro de département (deux premiers chiffres du code postal) indiqué dans l’adresse du client
select identite_id from identite where (postal_cp LIKE ‘XX%’) and FicheSupprimer=’N’ and identite_id=@identite_id
Ex.: pour les clients d’Île de France :
select identite_id from identite where (postal_cp LIKE ‘91%’ or postal_cp LIKE ‘92%’ or postal_cp LIKE ‘93%’ or postal_cp LIKE ‘94%’ or postal_cp LIKE ‘95%’ or postal_cp LIKE ‘75%’ or postal_cp LIKE ‘77%’ or postal_cp LIKE ‘78%’) and FicheSupprimer=’N’ and identite_id=@identite_id
Filtre par numéro de fiche client
Où XX est le numéro du tiers que l’on souhaite sélectionner
select identite_id from identite where FicheSupprimer=’N’ and identite_id=XX and identite_id=@identite_id