### maj dept et région adhérents
# màj dept dans liste adhérents
UPDATE galette_adherents
SET dept_adh = LEFT(cp_adh, 2) WHERE cp_adh LIKE "_____";
UPDATE galette_adherents
SET dept_adh = "étranger" WHERE cp_adh NOT LIKE "_____";
# màj région dans liste adhérents
UPDATE galette_adherents SET galette_adherents.region_adh = (SELECT departements_regions.nom_reg FROM departements_regions WHERE departements_regions.num_dept LIKE galette_adherents.dept_adh);
### màj adhérents -> groupes régions
DELETE FROM `galette_groups_members` WHERE `id_group` >=1 AND `id_group`<=128;
# * France
INSERT INTO galette_groups_members(id_group,id_adh)
SELECT grp.id_group, adh.id_adh
FROM galette_adherents adh, galette_groups grp
WHERE adh.region_adh LIKE grp.group_name;
# * étrangers
INSERT INTO galette_groups_members(id_group,id_adh)
SELECT grp.id_group, adh.id_adh
FROM galette_adherents adh, galette_groups grp
WHERE adh.pays_adh LIKE grp.group_name;
# adhérents -> groupe département
INSERT INTO `galette_groups_members`(`id_group`, `id_adh`) SELECT galette_groups.id_group, galette_adherents.id_adh FROM galette_adherents,galette_groups,departements_regions WHERE galette_adherents.dept_adh LIKE departements_regions.num_dept AND departements_regions.nom_dept = galette_groups.group_name;