Created
February 6, 2017 15:11
-
-
Save alexaleluia12/103448601ecee1e70fcaeafdd11a3c92 to your computer and use it in GitHub Desktop.
zero na frente do cnpj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- cnpj valido tem tamanho 14 | |
-- usar as funcoes length e concat | |
-- | |
UPDATE `cliente` ta, | |
(SELECT cnpj, id from `cliente` where length(cnpj) = 13) tb | |
SET ta.cnpj = concat('0', tb.cnpj) | |
where ta.id = tb.id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment