Deleting from two h2 tables with a foreign key
问题 I have an h2 database with two tables with foreign keys like CREATE TABLE master (masterId INT PRIMARY KEY, slaveId INT); CREATE TABLE slave (slaveId INT PRIMARY KEY, something INT, CONSTRAINT fk FOREIGN KEY (slaveId) REFERENCES master(slaveId)); and need something like DELETE master, slave FROM master m JOIN slave s ON m.slaveId = s.slaveId WHERE something = 43; i.e., delete from both tables (which AFAIK works in MySql). Because of the FOREIGN KEY I can't delete from the master first. When I