Update Join SQL problem

Hello!
I have problem using update in Join
This is my essay

UPDATE Table2
    INNER JOIN Table1 ON Table2.pro_id=Table1.entity_id
SET Table2.coluln22_id = 2
    WHERE Table1.column3='558987';

The error that is shown is this
[23000][1452] Cannot add or update a child row: a foreign key constraint fails (lxxxxx.xxxx, CONSTRAINT FK_xxxxx FOREIGN KEY (xxx_id) REFERENCES xxxx (xxxx_id`) ON)

Thanks in advance

Well, the error tells you your update is failing due to the FK restraints on your tables.

So what are the foreign key restraints on your tables?

1 Like