• The BINARY and VARBINARY Types


    mysql> CREATE TABLE t (c BINARY(3));
    Query OK, 0 rows affected (0.21 sec)
    
    mysql> INSERT INTO t SET c = 'a';
    Query OK, 1 row affected (0.18 sec)
    
    mysql>  SELECT HEX(c), c = 'a', c = 'a' from t;
    +--------+---------+-------------+
    | HEX(c) | c = 'a' | c = 'a' |
    +--------+---------+-------------+
    | 610000 |       0 |           1 |
    +--------+---------+-------------+
    1 row in set (0.00 sec)
    
    mysql> INSERT INTO t SET c = 'a';
    Query OK, 1 row affected (0.19 sec)
    
    mysql>  SELECT HEX(c), c = 'a', c = 'a' from t;
    +--------+---------+-------------+
    | HEX(c) | c = 'a' | c = 'a' |
    +--------+---------+-------------+
    | 610000 |       0 |           1 |
    | 610000 |       0 |           1 |
    +--------+---------+-------------+
    2 rows in set (0.00 sec)
    
    mysql> INSERT INTO t SET c = 'a ';
    Query OK, 1 row affected (0.19 sec)
    
    mysql>  SELECT HEX(c), c = 'a', c = 'a' from t;
    +--------+---------+-------------+
    | HEX(c) | c = 'a' | c = 'a' |
    +--------+---------+-------------+
    | 610000 |       0 |           1 |
    | 610000 |       0 |           1 |
    | 612000 |       0 |           0 |
    +--------+---------+-------------+
    3 rows in set (0.00 sec)
    
    mysql> SELECT x'4D7953514C';
    +---------------+
    | x'4D7953514C' |
    +---------------+
    | MySQL         |
    +---------------+
    1 row in set (0.00 sec)
    
    mysql> select x'612000';
    +-----------+
    | x'612000' |
    +-----------+
    | a         |
    +-----------+
    1 row in set (0.00 sec)
    
    mysql> select x'610000';
    +-----------+
    | x'610000' |
    +-----------+
    | a         |
    +-----------+
    1 row in set (0.00 sec)
    mysql> CREATE TABLE t2 (c varBINARY(3));
    Query OK, 0 rows affected (0.23 sec)
    
    mysql> INSERT INTO t2 SET c = 'a';
    Query OK, 1 row affected (0.17 sec)
    
    mysql> select * from t2;
    +------+
    | c    |
    +------+
    | a    |
    +------+
    1 row in set (0.00 sec)
    
    mysql> SELECT HEX(c), c = 'a', c = 'a' from t2;
    +--------+---------+-------------+
    | HEX(c) | c = 'a' | c = 'a' |
    +--------+---------+-------------+
    | 61     |       1 |           0 |
    +--------+---------+-------------+
    1 row in set (0.00 sec)
  • 相关阅读:
    化DataSet对象并压缩
    数据库连接
    触发器
    事务
    关于C语言的宏
    GCC中的一些参数
    《tkinter实用教程六》tkinter ttk.Label 控件
    《tkinter实用教程三》ttk.Button 控件
    5. 替换空格
    《tkinter实用教程二》ttk 子模块
  • 原文地址:https://www.cnblogs.com/zengkefu/p/5598169.html
Copyright © 2020-2023  润新知