0

so I have a small database I'm fooling around with and trying to get better at. I currently have a table filled with employee names and notes (just a mock up) so the result would look something like this:

Name / Employee # / Note

where it includes the employees name, their number, and a written note about the employee. I have written some sample text in the notes like "Is a great worker, never late - Adam"

SELECT * FROM `employees` WHERE `Note` LIKE '%Adam%'

I can use that to display all the notes that were posted by Adam, but lets say I want to change the name from Adam to Brad without having to rewrite every note, is there a way to replace that specific text but keep the rest of the note?

Thanks

Dharman
  • 21,838
  • 18
  • 57
  • 107
  • 1
    See [MySQL string replace](https://stackoverflow.com/q/5956993) or, for more more general/complicated searches, [How to do a regular expression replace in MySQL?](https://stackoverflow.com/q/986826). – Solarflare Dec 22 '19 at 06:46

1 Answers1

0

You can use the following query:

update employees set Note = REPLACE(Note, 'Adam', 'Brad');

Check out this link for more info: MySql Reference Manual