zoukankan      html  css  js  c++  java
  • postgresql中null对!=的影响

    今天开发问我,为什么!=操作不能获取值为null记录:

    abce=# select id,
    abce-#         a_no,
    abce-#         a_code,
    abce-#         a_number,
    abce-#         date_receive,
    abce-#         bank_a,
    abce-#         status
    abce-# from
    abce-#         erp_a_examine 
    abce-# where
    abce-#         ( a_number = '1023' and a_code = '231174' and status != '已作废' );
     id  | a_no | a_code | a_number | date_receive | bank_a | status 
    -----+------+--------+----------+--------------+--------+--------
    (0 rows)
    
    abce=# select id,
    abce-#         a_no,
    abce-#         a_code,
    abce-#         a_number,
    abce-#         date_receive,
    abce-#         bank_a,
    abce-#         status
    abce-# from
    abce-#         erp_a_examine 
    abce-# where
    abce-#         ( a_number = '1023' and a_code = '231174' );
     id  | a_no | a_code | a_number | date_receive | bank_a | status 
    -----+------+--------+----------+--------------+--------+--------
     333 | 1023 | 231174 | 12155    | 2010-03-02   |        | 
    (1 row)
    
    abce=# 
    

      

    只是因为null是非safe的操作。

  • 相关阅读:
    office2007快捷键
    To be solved
    网址Favorites
    C#网址
    developer's website
    Visual Studio快捷键
    如何跟进大客户?
    这些话让我们意识到流程的重要性
    恭祝大家情人节快乐!
    知已知彼,大客户管理10策
  • 原文地址:https://www.cnblogs.com/abclife/p/13629477.html
Copyright © 2011-2022 走看看