refs #5540 sql mod
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Satorres 2023-04-12 14:52:59 +02:00
parent 60103fa80a
commit 747efc4342
1 changed files with 3 additions and 5 deletions

View File

@ -1,5 +1,3 @@
UPDATE vn.supplier s
JOIN vn.country c ON c.id = s.countryFk
SET s.nif = MID(REPLACE(s.nif, ' ', ''), 3, LENGTH(REPLACE(s.nif, ' ', '')) - 1)
WHERE s.isVies = TRUE
AND c.code = LEFT(REPLACE(s.nif, ' ', ''), 2);
UPDATE vn.supplier
SET nif = SUBSTRING(nif, IF(ASCII(SUBSTRING(nif, 1, 1)) BETWEEN 65 AND 90 AND ASCII(SUBSTRING(nif, 2, 1)) BETWEEN 65 AND 90, 3, 1), LENGTH(nif))
WHERE isVies = 1 AND nif REGEXP '^[a-zA-Z]{2}';