如新批量更新这5条记录的Iaccept字段?

jb2008 2003-09-09 03:01:37
这是我先出来的记录
select top 5 * from acceptmessage where acceptuser='me' and Isaccept=0
我要把上面选出的记录中的Isaccept更新为1,高手指教。
...全文
50 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
brook_huang 2003-09-09
  • 打赏
  • 举报
回复
set rowcount 5
update acceptmessage
set Isaccept=1
where acceptuser='me' and
Isaccept=0
set rowcount 0
Myyokel 2003-09-09
  • 打赏
  • 举报
回复
update acceptmessage
set isaccept=1
where id列 in (
select top 5 id列 from acceptmessage where acceptuser='me' and Isaccept=0

Myyokel 2003-09-09
  • 打赏
  • 举报
回复
update isaccept=1
where id列 in (
select top 5 id列 from acceptmessage where acceptuser='me' and Isaccept=0

34,874

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧