dhl:SQL_游标.sql

--游标变量
declare @pingcoid  varchar(50)

declare cur cursor fast_forward for
select top 300 pingcoid from OpenDoor.Userinfo order by point desc
open cur
fetch cur into  @pingcoid
while @@fetch_status =0
begin
--循环


fetch next from cur into @pingcoid
end
close cur
deallocate cur

 

你可能感兴趣的:(sql)