是否可以在表之间删除?
像...一样的东西。
delete from bd between table1 and table 10 where vehicle 761
delete from bd.table_1 where id_vehicle=761
delete from bd.table_10 where id_vehicle=761
答案 0 :(得分:0)
您可以编写存储过程(查看mysql dynamic query in stored procedure) 或更改表结构,以便车辆ID通过外键约束相关(然后您可以执行级联删除,请参阅http://www.mysqltutorial.org/mysql-on-delete-cascade),或使用一个大表存储所有内容,但按日期对其进行分区,如果内容确实达到了一个大小,有意义。