Skip to content

Instantly share code, notes, and snippets.

@wilxsv
Created June 19, 2018 15:44
Show Gist options
  • Save wilxsv/67d26caa1d3d045300a1833a138bb45b to your computer and use it in GitHub Desktop.
Save wilxsv/67d26caa1d3d045300a1833a138bb45b to your computer and use it in GitHub Desktop.
Reemplazar acentos y caracteres especiales en mysql
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'Á','A');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'É','E');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'Í','I');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'Ó','O');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'Ú','U');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'Ñ','N');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ã','a');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ä','a');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'å','a');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'æ','a');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ç','c');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'è','e');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'é','e');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ê','e');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ë','e');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ì','i');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'í','i');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'î','i');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ï','i');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ð','o');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ñ','n');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ò','o');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ó','o');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ô','o');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'õ','o');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ö','o');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ø','o');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ù','u');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ú','u');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'û','u');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ý','y');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ý','y');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'þ','b');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ÿ','y');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ƒ','f');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'.',' ');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,' ','-');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'--','-');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ě','e');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ž','z');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'š','s');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'č','c');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ř','r');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ď','d');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ť','t');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ň','n');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ů','u');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'Ě','E');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'Ž','Z');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'Š','S');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'Č','C');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'Ř','R');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'Ď','D');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'Ť','T');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'Ň','N');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'Ů','U');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment