比较复杂的一个SQL问题,请高手解答

[复制链接]
查看11 | 回复2 | 2013-3-26 13:26:34 | 显示全部楼层 |阅读模式
用游标搞定:declare @min intdeclare @max intdeclare cur cursor for select ID from QIDopen curdeclare @id intfetch cur into @idwhile(@@fetch_status=0)beginSELECT @min=底界,@max=顶界 from QID where id=@idUPDATE 量级=量级+1 WHERE FF>@min AND FFcu.底界;
commit;
end loop;end;...
回复

使用道具 举报

千问 | 2013-3-26 13:26:34 | 显示全部楼层
若我没理解错你的意思,应该这么写:update 量级 = 量级 + 1 where ff > 底界 and ff < 顶界;...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行