惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Privacy & Cybersecurity Law Blog
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
罗磊的独立博客
F
Fortinet All Blogs
T
Threatpost
Y
Y Combinator Blog
博客园_首页
美团技术团队
Security Latest
Security Latest
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
V
V2EX - 技术
The Cloudflare Blog
L
LINUX DO - 热门话题
博客园 - 司徒正美
Jina AI
Jina AI
P
Proofpoint News Feed
宝玉的分享
宝玉的分享
C
CXSECURITY Database RSS Feed - CXSecurity.com
C
Cybersecurity and Infrastructure Security Agency CISA
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
WordPress大学
WordPress大学
The Hacker News
The Hacker News
P
Privacy International News Feed
T
The Exploit Database - CXSecurity.com
Scott Helme
Scott Helme
有赞技术团队
有赞技术团队
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
M
MIT News - Artificial intelligence
Latest news
Latest news
NISL@THU
NISL@THU
Google DeepMind News
Google DeepMind News
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Cisco Blogs
雷峰网
雷峰网
Application and Cybersecurity Blog
Application and Cybersecurity Blog
B
Blog RSS Feed
W
WeLiveSecurity
D
DataBreaches.Net
G
Google Developers Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
GRAHAM CLULEY
Spread Privacy
Spread Privacy
Know Your Adversary
Know Your Adversary
TaoSecurity Blog
TaoSecurity Blog
S
Securelist
Help Net Security
Help Net Security

博客园 - FilyCks

SQL动态条件查询例子 日期格式化函数 解决日志文件满造成的无法写入问题 数据库的日志文件 Delphi制作DLL SQLSERVER 日期函数及取当天数据 SQL语句导入导出大全 日期数据处理 按时间段统计数据(1) FastReport(5) FastReport(4) FastReport(3) FastReport(2) - FilyCks FastReport(1) FastReport 的初学感悟 查询表(个人笔记) 图片转换和读取(个人笔记) - FilyCks 游标的一些例子 自己研究出来的第一个游标
游标嵌套(个人笔记)
FilyCks · 2008-03-13 · via 博客园 - FilyCks


create table #temp(tem_archno varchar(50),tem_pages int,tem_org int,tem_copy1 int)
declare @temp_archno varchar(50) 
declare @temp_pages int
declare @temp_org int
declare @temp_iscopy bit
declare @temp_iscopy1 int
                
declare mycursor cursor for select archno,archorgpages from archflow_t where

archbatchno='L20080312-01'order by archno 

open mycursor                  

fetch next from mycursor  into @temp_archno,@temp_pages  

while(@@fetch_status=0)   
begin
   set @temp_iscopy1=0
   declare mycursor1 cursor for select iscopy from imageproperty_t where archno=@temp_archno
   open mycursor1
   fetch next from mycursor1  into @temp_iscopy               

     
   while(@@fetch_status=0)
   begin
 
  if @temp_iscopy<>0
  set @temp_iscopy1=@temp_iscopy1+1
  fetch next from mycursor1 into @temp_iscopy
   end
   set @temp_org=@temp_pages-@temp_iscopy1
   insert into #temp values(@temp_archno,@temp_pages,@temp_org,@temp_iscopy1)
   fetch next from mycursor into @temp_archno,@temp_pages
   close mycursor1  
   deallocate mycursor1
end

close mycursor


select * from #temp order by tem_archno