Thursday, 29 January 2009

SQL delete with join

This statement deletes data from Table1. This is useful if you have a join with multiple tables or multiple columns.
DELETE Table1
FROM Table1 t1 JOIN Table2 t2 
ON t1.Id1 = t2.Id1
AND t1.Id2 = t2.Id2

No comments:

Post a Comment