SELECT code FROM `entetecommercials` where code like '6-BLKU10102%' and id >=688985 and id <= 689284



update entetecommercials set code = CONCAT(code, '-1') where code in ('6-BLKU1010251','6-BLKU1010252','6-BLKU1010253','6-BLKU1010254','6-BLKU1010255','6-BLKU1010256','6-BLKU1010257','6-BLKU1010258','6-BLKU1010259','6-BLKU1010260','6-BLKU1010261','6-BLKU1010262','6-BLKU1010263','6-BLKU1010264','6-BLKU1010265','6-BLKU1010266','6-BLKU1010267','6-BLKU1010268','6-BLKU1010269','6-BLKU1010270','6-BLKU1010271','6-BLKU1010272','6-BLKU1010273','6-BLKU1010274','6-BLKU1010275','6-BLKU1010276')



update mouvements set numero = CONCAT(numero, '-1') where numero in ('6-BLKU1010251','6-BLKU1010252','6-BLKU1010253','6-BLKU1010254','6-BLKU1010255','6-BLKU1010256','6-BLKU1010257','6-BLKU1010258','6-BLKU1010259','6-BLKU1010260','6-BLKU1010261','6-BLKU1010262','6-BLKU1010263','6-BLKU1010264','6-BLKU1010265','6-BLKU1010266','6-BLKU1010267','6-BLKU1010268','6-BLKU1010269','6-BLKU1010270','6-BLKU1010271','6-BLKU1010272','6-BLKU1010273','6-BLKU1010274','6-BLKU1010275','6-BLKU1010276')


update paiements set code_bl = CONCAT(code_bl, '-1') where code_bl in ('6-BLKU1010251','6-BLKU1010252','6-BLKU1010253','6-BLKU1010254','6-BLKU1010255','6-BLKU1010256','6-BLKU1010257','6-BLKU1010258','6-BLKU1010259','6-BLKU1010260','6-BLKU1010261','6-BLKU1010262','6-BLKU1010263','6-BLKU1010264','6-BLKU1010265','6-BLKU1010266','6-BLKU1010267','6-BLKU1010268','6-BLKU1010269','6-BLKU1010270','6-BLKU1010271','6-BLKU1010272','6-BLKU1010273','6-BLKU1010274','6-BLKU1010275','6-BLKU1010276')



update mouvement_clients set entetcommercial_code = CONCAT(entetcommercial_code, '-1') where entetcommercial_code in ('6-BLKU1010251','6-BLKU1010252','6-BLKU1010253','6-BLKU1010254','6-BLKU1010255','6-BLKU1010256','6-BLKU1010257','6-BLKU1010258','6-BLKU1010259','6-BLKU1010260','6-BLKU1010261','6-BLKU1010262','6-BLKU1010263','6-BLKU1010264','6-BLKU1010265','6-BLKU1010266','6-BLKU1010267','6-BLKU1010268','6-BLKU1010269','6-BLKU1010270','6-BLKU1010271','6-BLKU1010272','6-BLKU1010273','6-BLKU1010274','6-BLKU1010275','6-BLKU1010276')



update visites set visite_code = CONCAT(visite_code, '-1') where visite_code in ('6-BLKU1010251','6-BLKU1010252','6-BLKU1010253','6-BLKU1010254','6-BLKU1010255','6-BLKU1010256','6-BLKU1010257','6-BLKU1010258','6-BLKU1010259','6-BLKU1010260','6-BLKU1010261','6-BLKU1010262','6-BLKU1010263','6-BLKU1010264','6-BLKU1010265','6-BLKU1010266','6-BLKU1010267','6-BLKU1010268','6-BLKU1010269','6-BLKU1010270','6-BLKU1010271','6-BLKU1010272','6-BLKU1010273','6-BLKU1010274','6-BLKU1010275','6-BLKU1010276')


------------------------------- AVOIR 
 SELECT id ,code FROM `entetecommercials` where code like '6-AVKU1010%' and id <= 689249





update entetecommercials set code = CONCAT(code, '-1') where code in ('6-AVKU101000','6-AVKU101001','6-AVKU101002','6-AVKU101003','6-AVKU101004','6-AVKU101005','6-AVKU101006','6-AVKU101007','6-AVKU101008','6-AVKU101009')



update mouvements set numero = CONCAT(numero, '-1') where numero in ('6-AVKU101000','6-AVKU101001','6-AVKU101002','6-AVKU101003','6-AVKU101004','6-AVKU101005','6-AVKU101006','6-AVKU101007','6-AVKU101008','6-AVKU101009')


update paiements set code_bl = CONCAT(code_bl, '-1') where code_bl in ('6-AVKU101000','6-AVKU101001','6-AVKU101002','6-AVKU101003','6-AVKU101004','6-AVKU101005','6-AVKU101006','6-AVKU101007','6-AVKU101008','6-AVKU101009')



update mouvement_clients set entetcommercial_code = CONCAT(entetcommercial_code, '-1') where entetcommercial_code in ('6-AVKU101000','6-AVKU101001','6-AVKU101002','6-AVKU101003','6-AVKU101004','6-AVKU101005','6-AVKU101006','6-AVKU101007','6-AVKU101008','6-AVKU101009')



update visites set visite_code = CONCAT(visite_code, '-1') where visite_code in ('6-AVKU101000','6-AVKU101001','6-AVKU101002','6-AVKU101003','6-AVKU101004','6-AVKU101005','6-AVKU101006','6-AVKU101007','6-AVKU101008','6-AVKU101009')

