Sql server update/delete 和 join联查

update A set a.name = 'testName'
from A a
join b on a.id = b.destId
join c on b.destId = c.sourceId
where a.id > 0 and c.name = 'test'



delete a from A a
join b on a.id = b.destId
join c on b.cid = c.id
where c.name = 'tets'

 

你可能感兴趣的:(数据库)