日期:2014-05-19  浏览次数:20617 次

如何只更新一张表的前十条记录?
我只想把一张表的前十条记录update一下,这个sql该怎么写?

------解决方案--------------------
UPDATE authors
SET state = 'ZZ '
FROM (SELECT TOP 10 * FROM authors ORDER BY au_lname) AS t1
WHERE authors.au_id = t1.au_id

------解决方案--------------------
set rowcount 10

update ...

set rowcount 0