salix/db/changes/231801/00-updateisViesClient.sql

6 lines
247 B
MySQL
Raw Normal View History

2023-05-04 07:02:23 +00:00
UPDATE IGNORE `vn`.`client` c
JOIN `vn`.`country` co ON co.id = c.countryFk
SET c.fi = MID(REPLACE(c.fi, ' ', ''), 3, LENGTH(REPLACE(c.fi, ' ', '')) - 1)
WHERE c.isVies = TRUE
AND co.code = LEFT(REPLACE(c.fi, ' ', ''), 2);