Sunday, March 15, 2015

Update & Delete Statement With Inner join

UPDATE Table1 SET Column1=@Value
FROM Table1 a
INNER JOIN Table2 b ON a.ID = b.ID
WHERE b.ID=

-----------------------------------

DELETE Table1
FROM Table1 a
INNER JOIN Table2 b on a.ID = b.ID
WHERE b.ID is not null

------------------------------------

Delete Top Number in Table

DELETE TOP (8) FROM Table1
WHERE ID = 1

No comments:

Post a Comment