Ai
74 Star 703 Fork 309

郑州微厦/AI培训学习-题库-考试-视频-直播

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
2023-02-17.sql 506 Bytes
一键复制 编辑 原始数据 按行查看 历史
/*学员组中增加学员数量*/
alter table [StudentSort] add [Sts_Count] [int] default 0 NOT NULL
go
declare cursor_acc cursor scroll
for select Sts_ID,COUNT(*) as 'count' from Accounts group by Sts_ID
open cursor_acc
declare @stsid bigint, @count int
fetch First from cursor_acc into @stsid,@count
while @@fetch_status=0
begin
update [StudentSort] set [Sts_Count]=@count where Sts_ID=@stsid
fetch next from cursor_acc into @stsid,@count
end
--关闭并释放游标
close cursor_acc
deallocate cursor_acc
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/weishakeji/LearningSystem.git
git@gitee.com:weishakeji/LearningSystem.git
weishakeji
LearningSystem
AI培训学习-题库-考试-视频-直播
master

搜索帮助