Knowing the right MySQL statement is the most important part in having thousands of data in your database, one false move and you can’t undo things.    If you want to change a string or character in your database and doing it manually in thousands or millions of entries then that should consume all of your time.

One example scenario is when you want to change all the entries containing a character ‘_’ to this character ‘-’ .  All you need to do is have a backup first on that specific table or database so that whatever false move you  will be doing, you can still have the data back.  After having the backup here is the SQL syntax that you should enter:

UPDATE Table SET Column = Replace(Column, ‘find value’, ‘replacement value’) WHERE xxx

Where in my scenario:

UPDATE paging SET pagename = Replace(pagename, ‘_’, ‘-’)

There within less than a minute I was able to change all the data containing ‘_’.  It saved me a lot of time and I can continue coding some other stuff rather than editing the data manually.  Hope this helps and happy coding!