zoukankan      html  css  js  c++  java
  • mysql比较运算符和函数

    mysql> SELECT 15 BETWEEN 1 AND 22;
    +---------------------+
    | 15 BETWEEN 1 AND 22 |
    +---------------------+
    | 1 |
    +---------------------+
    1 row in set (0.00 sec)

    mysql>
    mysql> SELECT 22 BETWEEN 1 AND 22;
    +---------------------+
    | 22 BETWEEN 1 AND 22 |
    +---------------------+
    | 1 |
    +---------------------+
    1 row in set (0.00 sec)

    mysql> SELECT 32 BETWEEN 1 AND 22;
    +---------------------+
    | 32 BETWEEN 1 AND 22 |
    +---------------------+
    | 0 |
    +---------------------+
    1 row in set (0.00 sec)

    mysql> SELECT 32 NOT BETWEEN 1 AND 22;
    +-------------------------+
    | 32 NOT BETWEEN 1 AND 22 |
    +-------------------------+
    | 1 |
    +-------------------------+
    1 row in set (0.00 sec)

    mysql> SELECT 10 IN(5,10,15);
    +----------------+
    | 10 IN(5,10,15) |
    +----------------+
    | 1 |
    +----------------+
    1 row in set (0.03 sec)

    mysql> SELECT 13 IN(5,10,15);
    +----------------+
    | 13 IN(5,10,15) |
    +----------------+
    | 0 |
    +----------------+
    1 row in set (0.00 sec)

    mysql> SELECT NULL IS NULL;
    +--------------+
    | NULL IS NULL |
    +--------------+
    | 1 |
    +--------------+
    1 row in set (0.00 sec)

    mysql> SELECT '' IS NULL;
    +------------+
    | '' IS NULL |
    +------------+
    | 0 |
    +------------+
    1 row in set (0.00 sec)

    mysql> SELECT 0 IS NULL;
    +-----------+
    | 0 IS NULL |
    +-----------+
    | 0 |
    +-----------+
    1 row in set (0.00 sec)

    mysql> SELECT * FROM test;
    +----+----------+
    | id | username |
    +----+----------+
    | 1 | John |
    | 2 | Mary |
    | 3 | 1%Lily |
    | 4 | Rose |
    | 5 | NULL |
    +----+----------+
    5 rows in set (0.00 sec)

    mysql> SELECT * FROM test WHERE USERNAME IS NULL;
    +----+----------+
    | id | username |
    +----+----------+
    | 5 | NULL |
    +----+----------+

    mysql> SELECT * FROM test WHERE USERNAME IS NOT NULL;
    +----+----------+
    | id | username |
    +----+----------+
    | 1 | John |
    | 2 | Mary |
    | 3 | 1%Lily |
    | 4 | Rose |
    +----+----------+

  • 相关阅读:
    LeetCode 234——回文链表
    【转】Jmeter常见问题
    【转】JMeter 聚合报告之90% Line参数说明
    【转】Jmeter + DadBoby 安装使用
    【转】JMeter远程测试
    【转】关于一个Jmeter interface testing的实例
    【转】Jmeter 代理服务器录制脚本
    【转】Jmeter和LR上传文件和下载
    【转】Jmeter JDBC请求的问题
    【转】Jmeter的正则表达式未正确提取数据
  • 原文地址:https://www.cnblogs.com/toudoubao/p/6636072.html
Copyright © 2011-2022 走看看