• 设置库位排序规则


    CREATE TABLE #tb
           (
             id INT IDENTITY ,
             LocationName VARCHAR(24) ,
             LocationIndex INT NULL
           )

    INSERT  INTO #tb
            (
              LocationName
            )
            SELECT  '1015-02A01'
            UNION
            SELECT  '1015-01A01'
            UNION
            SELECT  '1016-04A01'
            UNION
            SELECT  '1016-05A01'
            UNION
            SELECT  '1017-01A01'
            UNION
            SELECT  '1010-01A01'
            UNION
            SELECT  '1016-02A01'
            UNION
            SELECT  '1016-07A01'
            UNION
            SELECT  '1015-03A01'
            UNION
            SELECT  '1015-04A01'
            


    SELECT  * ,
            new_id = row_number() OVER ( ORDER BY CASE WHEN LEFT(LocationName, 2) = 10
                                                       THEN LEFT(LocationName, 4)
                                                  END DESC
                                                   , CASE WHEN LEFT(LocationName,
                                                                  4) IN ( '1015',
                                                                  '1016' )
                                                          THEN SUBSTRING(LocationName,
                                                                  6, 2) % 2
                                                     END, SUBSTRING(LocationName,
                                                                  6, 2) )
    FROM    #tb WITH ( NOLOCK )

  • 相关阅读:
    网络游戏
    嘎嘎
    Failed to install *.apk on device 'emulator-5554': timeout
    安卓开发真机遇到Failed to install Spaceassault.apk on device 'HT1CKV205198': timeout 测试机没有问题
    java匿名内部类
    TextView tv01=(TextView)this.findViewById(R.id.TextView01); tv01.setText("设置文字背景色");
    android 项目中出现红色感叹号的解决方法
    使用block来解决实现switch解决字符串
    oc中的block
    不可变数组或者可变数组进行排序
  • 原文地址:https://www.cnblogs.com/pato/p/3546192.html
Copyright © 2020-2023  润新知