34,594
社区成员
发帖
与我相关
我的任务
分享
declare @id int
declare mycursor cursor for select * from tb
open mycursor
fetch next from mycursor into @id
while(@@FETCH_STATUS=0)
begin
if(@id > 60)
begin
print @id
end
fetch next from mycursor into @id
end
close mycursor
deallocate mycursor
--逐行遍历
--不过有时候定位挺好用