是否可以级联删除与Liquibase xml?
例如,假设我有以下表,我想从Drivers中删除一行。我还想删除CarDrivers中的所有相关行。
Table Cars:
CarID int
CarName nvarchar(100)
Table Drivers:
DriverID int
DriverName nvarchar(100)
Table CarDrivers:
CarID int
DriverID int
执行此操作的SQL看起来像这样:
DELETE
FROM CarDrivers cd
WHERE cd.DriverID IN (
SELECT ID
FROM Drivers d
WHERE d.DriverName IN ("John", "Smith")
);
DELETE
FROM Drivers
WHERE DriverName IN ("John", "Smith");
您可以使用