Is it possible to delete between tables?
Something like...
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
Is it possible to delete between tables?
Something like...
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
You can either write a stored procedure (look at mysql dynamic query in stored procedure) or change the table structure so that either the vehicle IDs are related via a foreign key constraint (then you can do cascading deletes, see http://www.mysqltutorial.org/mysql-on-delete-cascade), or use one big table to store everything, but partition it by date, if the content really reaches a size, where it makes sense.