You can use a join statement in a delete, and in this case this statement would have done the trick:
DELETE FROM ol
FROM Orders o
JOIN OrderLines ol
ON o.OrdNo=ol.OrdNo
WHERE o.OrdDate < '2003-03-01'
As there is no subquery it's more efficient. I have used this DELETE FROM...FROM construct many times with no adverse effects.
Edited by - RonKyle on 06/24/2003 06:52:20 AM
Edited by - RonKyle on 06/24/2003 06:52:42 AM