Skip to content
Advertisement

SQL IF in column THEN replace with the adjacent cell

I have a table with different values (alphanumeric) and an other one with translations (also alphanumeric). I want to search values from the first table if they are in a specific column of the other table. If yes, then replace with a value corresponding the row.

Example :

TABLE 1

TABLE 2

FINAL TABLE

So what I want is :

IF “from table1.type_of_products” IS IN {“table2.french”}

THEN replace by corresponding value in “table2.english”

Advertisement

Answer

You can use left join:

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement