Skip to content
Advertisement

Update a a column in some specific items of a table, with values from a column in another table

I have 3 tables. I want to update all Image rows from table 1, with local image from table 3.

Table 1 is liked with table 2 by ID. Table 2 and 3 are linked by itemRef.

As an example of what I want: is that ID 1 from table 1, gets image A. Because ID from table 1, is itemRef = 14 in table 2, and itemRef = 14 in table 3 has image A.

This is what I’ve tried so far:

Can you help me to make this?

Advertisement

Answer

Use proper joins in the UPDATE statement like this:

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