I have a table which uses UTF-8- default
collation.
I have a column in this table called company
which has this value Café Rouge
When I do the query like:
select * from company where name ='Cafe Rouge'
it lists this company because it treats the character é =e
but when I use the replace command, it does not treat é
as e
.
So,
select replace('Café Rouge','e','z')
gives me 'Café Rougz'
i.e. it does not replace é
with z
.
Any suggestions will be appreciable
I think among the good things you can do is maintain a second column which keeps these strings in a normal form; for example, this column would hold "Cafe Rouge" rather than "Café Rouge". You can project the exceptional characters in your query and then use the normal form column to query against.
Try
SELECT REPLACE(CONVERT(name USING ascii), 'e', 'z')
to convert the name
column to ASCII before doing the replace.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With