declare @stor_id varchar(20)
declare cur_s cursor for select stor_id from sales group by stor_id
open cur_s
fetch cur_s into @stor_id
while @@fetch_status = 0
begin
print @stor_id
fetch cur_s into @stor_id
end
close cur_s
deallocate cur_s
declare cur_s cursor for select stor_id from sales group by stor_id
open cur_s
fetch cur_s into @stor_id
while @@fetch_status = 0
begin
print @stor_id
fetch cur_s into @stor_id
end
close cur_s
deallocate cur_s

浙公网安备 33010602011771号