ERROR 1452: Cannot add or update a child row: a foreign key constraint fails

后端 未结 21 1796
野性不改
野性不改 2020-11-22 07:01

I have created tables in MySQL Workbench as shown below :

ORDRE table:

CREATE TABLE Ordre (
  OrdreID   INT NOT NULL,
  OrdreDato DA         


        
21条回答
  •  太阳男子
    2020-11-22 07:44

    First allow NULL on the parent table and set the default values to NULL. Next create the foreign key relationship. Afterwards, you can update the values to match accordingly

提交回复
热议问题