我们是否可以使用下面的连接从表中删除记录而不使用IN
delete FROM Shippers
INNER JOIN Orders
ON Orders.Shipper_ID = Shippers.Shipper_ID
where Orders.Order_ID = 3
答案 0 :(得分:2)
不,你不能。
你可以做的是使用EXISTS
条款。
像这样:
DELETE FROM SHIPPERS S
WHERE EXISTS (SELECT 1
FROM ORDERS O
WHERE S.SHIPPER_ID = O.SHIPPER_ID
AND O.ORDER_ID = 3)