I need to find and replace multiplie strings from table "phrases" using table "dict"
I have code like:
update phrases, dict
set phrases.name = replace(phrases.name, dict.source, dict.translate)
where phrases.name <> replace(phrases.name, dict.source, dict.translate)
pharses table example:
id | name | .. | ..
1 | macbook wht comput | ..
2 | lenova blck god nb | ..
dict table example:
id | source | translate
1 | wht | white
2 | god | good
3 | lenova | lenovo
4 | blck | black
5 | comput | computer
6 | nb | notebook
I need get to phares like this:
id | name | .. | ..
1 | macbook white computer | ..
2 | lenova black good notebook | ..
It will replace only 1 string at once in row, but I have about 3-10 strings to replace.
How this code can be changed to replace all strings in rows?