zoukankan      html  css  js  c++  java
  • 逐条更新数据 sql

    declare @tid int       
    declare @fid int
    declare @i int
    declare @j int
    set @j=(select count(*) from tbl1.dbo.dnt_topics)
    set @i=1        
    while   @i<@j        
    begin            
        set @tid = (select tid from ( select ROW_NUMBER() over (order by tid asc ) as Row, tid,fid from dnt_topics ) as sp  where Row=@i)
        set @fid=(select fid from ( select ROW_NUMBER() over (order by tid asc ) as Row, tid,,fid from dnt_topics ) as sp  where Row=@i)                
        update            
            tbl2.dbo.dnt_topics         
        set                 
            fid=@fid        
        where             
            tid=@tid                    
            set @i=@i+1        
    end
  • 相关阅读:
    I/O模型
    同步异步与协程
    GIL(全局解释器锁)
    解决pycharm启动慢
    操作系统发展史
    TCP和UDP
    粘包问题
    网络编程
    异常
    常用函数汇总
  • 原文地址:https://www.cnblogs.com/swarb/p/9924288.html
Copyright © 2011-2022 走看看