0

I need to change an the id of 1 table. but the id is use on other tables. So how to create a sql query for update every table at the same time?

UPDATE table1,table2,table3
SET id = 2
where id=1

How create an update cascade query?

4

1 回答 1

0

如果您使用创建外键,ON UPDATE CASCADE您只需更新主键,所有引用都会自动更改。

于 2013-06-07T18:23:48.187 回答