Reputation: 77
In my database I have values containing Romanian diacritics and should be Ă
but are saved as ă
.
All I want to do is to replace all ă
substrings with Ă
.
For example if I have:
MăDăLIN
should be changed to MĂDĂLIN
ARAMă
should be changed to ARAMĂ
How can I do that?
Upvotes: 2
Views: 3433
Reputation: 66
MySQL defines a function called REPLACE that does exactly like PHP's str_replace.
You can use it to replace all occurences of a string in a column by doing :
UPDATE table SET column = REPLACE(column, 'ă', 'Ă');
The documentation of this function can be found at : http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace
Upvotes: 2
Reputation: 555
You may try this
UPDATE table_name
SET column_name = REPLACE(columnname, 'find_string', 'replace_with')
Upvotes: 5
Reputation: 9264
All string functions for Mysql can be found here: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html
You should try replace: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace
Upvotes: 0