UPDATE BaseUser SET G_ID = 10 WHERE G_ID =0 AND is_manager = 1AND ID IN(select top 3 ID from BaseUser order by newid()) 我执行这条语句, 为什么不能随即的更新三条数据, 而只是随机更新一条,两条,或者不更新?
2 回答
慕运维8079593
TA贡献1876条经验 获得超5个赞
UPDATE BaseUser SET G_ID = 10 WHERE ID IN(select top 3 ID from BaseUser where G_ID =0 AND is_manager = 1 order by newid())
HUH函数
TA贡献1836条经验 获得超4个赞
WHERE G_ID =0 AND is_manager = 1
AND ID IN(select top 3 ID from BaseUser order by newid())
3个and的条件,应该是随机的有几条符合,但是肯定是不大于3条的
- 2 回答
- 0 关注
- 721 浏览
添加回答
举报
0/150
提交
取消