如何在MySQL上的表中运行查找和替换

How to run Find & Replace in a table on MySQL
2023-01-06 05:23:09
MySQL SQL Programming Tips hashnode
如何在MySQL上的表中运行查找和替换

I bet you once already thought: 🤔💭

How cool would it be if I could run a "Find & Replace" on a database table...

The good news is that's totally possible. 🎉

Just have use the following query:

update <table_name> set <field_name> = replace(<field_name>,'<string_to_find>','<string_to_replace>');

Cool huh?!

© 2022 开源博客 京ICP备20030565号-2 Powered by Quick API team