Skip to content

Instantly share code, notes, and snippets.

@muriloazevedo
Forked from anonymous/update_enconding.sql
Created October 2, 2015 13:58
Show Gist options
  • Save muriloazevedo/937fe9466b0d769f715f to your computer and use it in GitHub Desktop.
Save muriloazevedo/937fe9466b0d769f715f to your computer and use it in GitHub Desktop.
Atualiza o encoding de latin1 para uft8 do campo "name", na tabela users.
SELECT CONVERT(CONVERT(name USING BINARY) USING latin1) AS latin1,
CONVERT(CONVERT(name USING BINARY) USING utf8) AS utf8
FROM users
WHERE CONVERT(name USING BINARY) RLIKE CONCAT('[', UNHEX('80'), '-', UNHEX('FF'), ']')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment