当我在 SQL Server 中执行此操作时
update table
set column = @value
where id in (1,2,2)
将执行多少次更新? 2 或 3,其中 id=2 的行有两个更新?
最佳答案
使用 select 测试您的代码。您将看到有多少行将被更新。
计数
select count(*) from table
where id in (1,2,2)
查看正在更新的行
select * from table
where id in (1,2,2)
如果 id 是一个主键(并且是唯一的,2 行)
关于sql server update where column in (duplicate values) - 有多少更新?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37719790/