zoukankan      html  css  js  c++  java
  • 手欠,大半个下午加一晚上就报销了。

    --select iFabricOrder, iPackageOrder,tPackageTime into #t1 from dbo.mmInDtl where sOrderNo = 'MLS_J210409M' and tPackageTime is not null
    
    declare @i int = 0, @t datetime
    --一定要在更新语句中初始化变量,再给字段赋值
    update  A  set @i = case @t when tPackageTime then @i else @i+1 end,
                        iPackageOrder = @i,
                        @t = tPackageTime
    from (select top 10000 * from dbo.mmInDtl where sOrderNo = 'MLS_J210409M' and tPackageTime is not null order by tPackageTime) A
    
    --select * from #t1 order by tPackageTime
    
    --drop table #t1
    select iPackageOrder, tPackageTime from dbo.mmInDtl where sOrderNo = 'MLS_J210409M' and tPackageTime is not null order by tPackageTime
  • 相关阅读:
    反射
    IO流
    集合(下)
    集合(上)
    泛型
    异常
    常用类
    内部类
    将博客搬至CSDN
    DBMS_ERRLOG记录DML错误日志(二)
  • 原文地址:https://www.cnblogs.com/captionAmazing/p/14995303.html
Copyright © 2011-2022 走看看