--标记id
--每次查询特定列比标记id大的第一条数据,
--同时更新标记id,直到查询结果为空
declare @id varchar(50)
set @id=''
    while 1=1
    begin
        select top 1 @id=id from T_SGZ where id>@id order by id 
        if @@ROWCOUNT=0
            break
            
        print(@id)
    end

 

相关文章:

  • 2022-12-23
  • 2021-11-29
  • 2021-10-19
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
猜你喜欢
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2022-01-22
  • 2022-01-02
  • 2022-01-02
  • 2021-09-06
相关资源
相似解决方案