• sql query skill


    https://www.w3resource.com/sqlite/sqlite-select-query-statement.php

    
     /*
     
     
     SELECT ChipID FROM "tb_XM1004_B_DWL_t2_f" WHERE ChipID!=0 AND T2_ChipResult!='DB_T2_T1ErrAddrNum_OutOfRange';
    
    
     CAST(ChipID AS CHAR(24))
    
     CHAR(ChipID)
     
     BIGINT('111')
     
     DIGITS(ChipID)
     Dec(ChipID)
     HEX(X)
     
     SELECT CONVERT(VARBINARY(50), 123456)
     
    http://www.cnblogs.com/gaizai/p/4001016.html
    concat(HEX(ChipID))
    
    和c 一样, 记得 X位数 之前要加0 , 比如 printf('%018X', V)  =>18个字符的16进制
    printf('%08X', V)  
    
    //多个参数
    printf("%08X,%08X,%08X", V1,V2,V3)  
    
    
    
    
    SELECT printf("%016X",ChipID),T1_ChipResult FROM "tb_XM1004_B_DWL_t1_f" WHERE ChipID<>0 AND T1_ChipResult <> "Status_T1_ErrAddrNum_OutOfRange" ORDER BY ChipID
    
    
    SELECT printf("%X",ChipID),T2_ChipResult FROM "tb_XM1004_B_DWL_t2_f" WHERE ChipID<>0 AND T2_ChipResult <> "DB_T2_T1ErrAddrNum_OutOfRange" AND T2_ChipResult <> "DB_T2_MergeErrAddrNum_OutOfRange" ORDER BY ChipID
    
    
    
     !=  和<> 都是不等于
    
    
    
     */
    
    SELECT printf('%X', ChipID),*  FROM "tb_XM1004_B_DWL_t2_f" WHERE ChipID != 0 AND T2_ChipResult != 'DB_T2_T1ErrAddrNum_OutOfRange';
    
    
    
    
    SELECT printf("%X",ChipID),T2_ChipResult FROM "tb_XM1004_B_DWL_t2_f" WHERE ChipID<>0 AND T2_ChipResult <> "DB_T2_T1ErrAddrNum_OutOfRange" AND T2_ChipResult <> "DB_T2_MergeErrAddrNum_OutOfRange" ORDER BY ChipID
    
    
    
    SELECT printf("%X",ChipID), printf("%X",BatchID) FROM "tb_XM1004_B_DWL_t1_p" ORDER BY ChipID LIMIT 1;
    
    
    SELECT COUNT(ChipID),printf("%X",ChipID), printf("%X",BatchID), T1_ChipResult FROM "tb_XM1004_B_DWL_t1_f" GROUP BY ChipID ORDER BY ChipID;
    
    
    
    
    SELECT printf("%X,%X,%X,%X",ChipID,BatchID,T1_Analog1_V12,T1_Analog2_V05) FROM "tb_XM1004_B_DWL_t1_f";
    
    
    
  • 相关阅读:
    angularjs $index用来取顺序
    angularjs &登录跳转
    if(!confirm("您确定删除吗?")){return;}
    登录跳转
    undefined null测试
    git生成密钥
    遍历map
    网络相关名词解释
    redis的Pub/Sub
    SQLAlchemy的使用
  • 原文地址:https://www.cnblogs.com/scotth/p/11884446.html
Copyright © 2020-2023  润新知