日期:2014-05-17 浏览次数:20707 次
declare 变量1
declare 变量2
declare cur1 cursor
for select * from 规则表
declare cur2 cursor
for select * from 考勤表
open cur1
fetch next from cur1 to 变量1
while @@FETCH_STATUS = 0
begin
open cur2
fetch next from cur2 to 变量2
while @@FETCH_STATUS = 0
begin
比较 变量1 和 变量2
end
close cur2
deallocate cur2
end
close cur1
deallocate cur1