jtrovato
04-25-2003, 04:26 AM
I want to create a single query to delete from 2 tables at once.
I know I can do it with 2 queries, but I want to take advantage of the new features in MySQL.
Tables
equipment
equipment_inter_table
Fields
equipment_id
The field is located in both tables and I want to delete the one record in the equipment DB and all the fields that have the ID in the equipment_inter_table
This is what I have so far:
DELETE FROM equipment as e ,equipment_inter_table as eit
WHERE e.equipment_id = eit.equipment_id AND e.equipment_id =40
Of course this doesn't work, I don't know how to modify this so it does work
Thanks
I know I can do it with 2 queries, but I want to take advantage of the new features in MySQL.
Tables
equipment
equipment_inter_table
Fields
equipment_id
The field is located in both tables and I want to delete the one record in the equipment DB and all the fields that have the ID in the equipment_inter_table
This is what I have so far:
DELETE FROM equipment as e ,equipment_inter_table as eit
WHERE e.equipment_id = eit.equipment_id AND e.equipment_id =40
Of course this doesn't work, I don't know how to modify this so it does work
Thanks
