Subject | Re: UPDATE AND DELETE WITH JOIN |
---|---|
Author | zaher dirkey |
Post date | 2006-07-15T12:27:59Z |
In short why we like to have join in UPDATE or DELETE
Select * from Bills
inner join Accounts on BillAccount = AccountID
is faster than
Select * from Bills
where BillAccount in (select AccountID from Accounts where BillAccount
= AccountID)
so we expect that
update Bills set
BillValue = 100
inner join Accounts on BillAccount = AccountID
is faster than
Select * from Bills
where BillAccount in (select AccountID from Accounts where BillAccount
= AccountID)
and join with UPDATE more easy to filter when use WHERE
update Bills set
BillValue = 100
inner join Accounts on BillAccount = AccountID
where AccountKind = 1
But update 2 table or more in one shot, i think is not logically for me.
Select * from Bills
inner join Accounts on BillAccount = AccountID
is faster than
Select * from Bills
where BillAccount in (select AccountID from Accounts where BillAccount
= AccountID)
so we expect that
update Bills set
BillValue = 100
inner join Accounts on BillAccount = AccountID
is faster than
Select * from Bills
where BillAccount in (select AccountID from Accounts where BillAccount
= AccountID)
and join with UPDATE more easy to filter when use WHERE
update Bills set
BillValue = 100
inner join Accounts on BillAccount = AccountID
where AccountKind = 1
But update 2 table or more in one shot, i think is not logically for me.