delete * from 表要是表中有外键约束的话,要先清空 外键表,然后才能清主表。比如 table1 的 有个字段是 uid,为主键;而uid在table2里属于外键,则需先删table2,再删table1:delete * from table2;delete * from table1;
删掉关联干嘛,直接 DELETE table_name ON DELETE CASCADE;直接就是级联删除了。
delete biaoming
delete