简体   繁体   English

如何使用查询更正 MySQL 列中的拼写错误?

[英]How can I correct spelling errors in MySQL column using a query?

I am new with mysql so I have inserted into a table column about 2000 records and some of them have spelling errors.我是 mysql 的新手,所以我已将大约 2000 条记录插入到表列中,其中一些有拼写错误。

Can I use我可以用吗

update Names set City = replace(City, "%New Yorks%", "New York");

but with an IF condition inside replace to check IF word has a particular character do the replace.但是在替换中使用 IF 条件来检查 IF 单词是否具有特定字符进行替换。

In several words I want to change the i with e and the a with o can I do them all together?简而言之,我想将 i 更改为 e,将 a 更改为 o 我可以一起做吗?

Thank you谢谢

使用单引号而不是双引号并丢失%

update Names set City = replace(City, 'New Yorks', 'New York');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM