游标操作实例
来源:互联网 发布:什么叫网络打印机 编辑:程序博客网 时间:2024/06/06 02:21
更新歌手MV歌曲数和歌手总人气
declare @gsid int
declare @songnum int
declare @songnum int
declare @songallhit int
declare rq cursor for select distinct gsid from MV歌曲表 where sh=1 and isok=0 order by gsid asc
open rq
fetch next from rq into @gsid
declare rq cursor for select distinct gsid from MV歌曲表 where sh=1 and isok=0 order by gsid asc
open rq
fetch next from rq into @gsid
while @@FETCH_STATUS = 0
begin
select @songnum =count(id),@songallhit=sum(allhit) from MV歌曲表 where gsid=@gsid and sh=1 and isok=0
update 歌手表 set mvnum=@songnum,mvrq=@songallhitwhere gsid= @gsid
fetch next from rq into @gsid
end
close rq
deallocate rq
begin
select @songnum =count(id),@songallhit=sum(allhit) from MV歌曲表 where gsid=@gsid and sh=1 and isok=0
update 歌手表 set mvnum=@songnum,mvrq=@songallhitwhere gsid= @gsid
fetch next from rq into @gsid
end
close rq
deallocate rq
- 游标操作实例
- 游标嵌套游标实例
- 游标实例
- 游标实例
- 游标实例
- 游标实例
- 游标操作
- 游标操作
- 游标操作
- 游标操作
- 游标操作
- Orcale 游标的实例
- SQL : 游标使用实例
- mysql游标实例
- 游标cursor实例
- sql游标实例
- SQL游标使用实例
- SQL 游标使用实例
- 函数的线程安全VS函数的可重入
- TS文件合并命令
- NetBIOS_spec
- 海量数据处理算法
- 分布式应用上下文(Distributed ThreadLocal)
- 游标操作实例
- Eclipse快捷键
- ASP.NET服务器控件CheckBoxList修改
- 如何在vs2008上设置出行号呢!
- HTML5基础,第2部分:组织页面的输入
- 生成随机数图片
- java的54种运算符及其优先级
- geotools 使用 部分代码总结
- 键盘键值--ascii码对应表