declare cursor_name cursor for
select field_name from tabe_name where field_name=@field_name
open cursor_name
fetch next from cursor_name into @temp_name
WHILE @@FETCH_STATUS = 0
begin
declare cursor_name1 cursor for select * from 另一个表 where xx=@temp_name
open cursor_name1
fetch next from cursor_name into @xxx
while....
begin
.....
end
close cursor_name1
deallocate cursor_name1 fetch next from cursor_name into @temp_name
End
close cursor_name deallocate cursor_name
select field_name from tabe_name where field_name=@field_name
open cursor_name
fetch next from cursor_name into @temp_name
WHILE @@FETCH_STATUS = 0
begin
declare cursor_name1 cursor for select * from 另一个表 where xx=@temp_name
open cursor_name1
fetch next from cursor_name into @xxx
while....
begin
.....
end
close cursor_name1
deallocate cursor_name1 fetch next from cursor_name into @temp_name
End
close cursor_name deallocate cursor_name
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货