I have a tbl_english table containing the column "word". I also have a table, tbl_translation, containing the columns "german_word" and "english_word".
tbl_translation is a lookup table to see if there are any Germanic words in the tbl_english "word" column
So what I want to do
For each tbl_english.word, iterate through tbl_translation.german_word and find the corresponding value. If the match exists, update tbl_english.word with the value in tbl_translation.english_word from the current line in tbl_translation
The goal is to replace any exiled German words existing in tbl_english with their correct translation from the tbl_translation lookup table
So far I have come up with the following:
UPDATE tbl_english SET word = (SELECT english_word FROM tbl_translation WHERE tbl_english.word = german_word) WHERE word IN (SELECT german_word FROM tbl_translation WHERE tbl_english.word = german_word )
However, this does not succeed when there are several instances of the same or different words obtained as a result of the first sub-selection. Is there an easy way to solve the problem?
Example:
tbl_english contains; Mädchen Frau Boy Giraffe Baum
tbl_translation contains (German, English); Mädchen, Female Frau, Woman
So, in tbl_english, I would like to see the following result; female female boy Giraffe Baum
Edit: not every word in tbl_english will have a reference string in the translation table. Edit2: Added example
source share