zoukankan      html  css  js  c++  java
  • mysql中的NULL的判断

     
    mysql> delete from `zhangchao` where x='NULL';
    
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> delete from `zhangchao` where x=NULL; 
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> select * from zhangchao;
    +------+-------+
    | x    | y     |
    +------+-------+
    | xxx  | yyy   |
    | NULL | NULL  |
    | xxx  | james |
    | xxx  | lucy  |
    | xxx  | alex  |
    +------+-------+
    5 rows in set (0.00 sec)
    
    mysql> delete from `zhangchao` where x  is null;
    Query OK, 1 row affected (0.00 sec)
    
    mysql> select * from zhangchao;
    +------+-------+
    | x    | y     |
    +------+-------+
    | xxx  | yyy   |
    | xxx  | james |
    | xxx  | lucy  |
    | xxx  | alex  |
    +------+-------+
    4 rows in set (0.00 sec)
    
    mysql>

    需要使用is null来进行判断。

  • 相关阅读:
    python
    shader example
    shader 关键字
    Android Studio如何导出可供Unity使用的aar插件详解 转
    adb
    知识
    Unity实现模拟按键
    小知识
    图种制作命令
    八卦
  • 原文地址:https://www.cnblogs.com/justinzhang/p/4780102.html
Copyright © 2011-2022 走看看