如何更新 sql server 中的前 100 条记录
我想更新 SQL Server 中的前 100 条记录.我有一个表 T1 字段 F1 和 F2.T1 有 200 条记录.我想更新前 100 条记录中的 F1 字段.如何根据 SQL Server 中的 TOP 100 进行更新?
I want to update the top 100 records in SQL Server. I have a table T1 with fields F1 and F2. T1 has 200 records. I want to update the F1 field in the top 100 records. How can I update based on TOP 100 in SQL Server?
推荐答案
注意,UPDATE语句需要括号:
Note, the parentheses are required for UPDATE statements:
update top (100) table1 set field1 = 1
相关文章