Change accented characters to unaccented ones

1

Is there any kind of method for me to do a replace in characters based on the CASE of the same? I'm looking for something like this:

UPDATE foo SET bar = SUBSTRING(bar, "Ã","ã");
-- se o caracter for LOWER -> ã
-- se o caracter for UPPER -> Ã

Imagine the table below:

-------------------------
| id | nome             |
-------------------------
|  1 | Cão              |
|  2 | ALEMÃO           |
|  3 | jOÃO             |
-------------------------

I need you to become this

-------------------------
| id | nome             |
-------------------------
|  1 | Cao              | -> trocou "ã" por "a"
|  2 | ALEMAO           | -> trocou "Ã" por "A"
|  3 | jOAO             | -> trocou "Ã" por "A"
-------------------------
    
asked by anonymous 30.08.2016 / 18:45

1 answer

2

You can use COLLATE to do this, I do not know if it's what you want or it will work, the question is too generic:

UPDATE foo SET bar = (SELECT bar COLLATE SQL_Latin1_General_Cp1251_CS_AS);
    
31.08.2016 / 10:46