i****a 发帖数: 36252 | 1 If the where clause in an update query hit multiple records for the same row
, which one gets written as the final update?
example
TableA:
Name, Value
A, 100
A, 200
A, 300
update TableB
set col1 = TableB.Value
from TableB
where TableB.Name = 'A'
i think it is by physical order but not guaranteed? | v*****r 发帖数: 1119 | 2 It should fail if updating one row with resultset >1, at least it is case
in oracle. | v*****r 发帖数: 1119 | 3 i mean subquery resultset > 1
【在 v*****r 的大作中提到】 : It should fail if updating one row with resultset >1, at least it is case : in oracle.
| j*****n 发帖数: 1781 | 4 This will depend on which row is the last one physically located in the
table for M$.
row
【在 i****a 的大作中提到】 : If the where clause in an update query hit multiple records for the same row : , which one gets written as the final update? : example : TableA: : Name, Value : A, 100 : A, 200 : A, 300 : update TableB : set col1 = TableB.Value
| y****w 发帖数: 3747 | 5 这个经典bug一直被当作经典sql server feature. 8
row
【在 i****a 的大作中提到】 : If the where clause in an update query hit multiple records for the same row : , which one gets written as the final update? : example : TableA: : Name, Value : A, 100 : A, 200 : A, 300 : update TableB : set col1 = TableB.Value
|
|