binary与not的优先级,哪一个高?MySQL完全手册上说是binary的高,而运行测试的结果(如下所示,版本为4.1.18-nt)正好相反,这是怎么回事?
mysql> select binary 'a' not in('A','B','C');
+--------------------------------+
| binary 'a' not in('A','B','C') |
+--------------------------------+
| 0 |
+--------------------------------+
1 row in set (0.01 sec)mysql> select 'a' not in('A','B','C');
+-------------------------+
| 'a' not in('A','B','C') |
+-------------------------+
| 0 |
+-------------------------+
1 row in set (0.00 sec)mysql> select (binary 'a') not in('A','B','C');
+----------------------------------+
| (binary 'a') not in('A','B','C') |
+----------------------------------+
| 1 |
+----------------------------------+
1 row in set (0.00 sec)
mysql> select binary 'a' not in('A','B','C');
+--------------------------------+
| binary 'a' not in('A','B','C') |
+--------------------------------+
| 0 |
+--------------------------------+
1 row in set (0.01 sec)mysql> select 'a' not in('A','B','C');
+-------------------------+
| 'a' not in('A','B','C') |
+-------------------------+
| 0 |
+-------------------------+
1 row in set (0.00 sec)mysql> select (binary 'a') not in('A','B','C');
+----------------------------------+
| (binary 'a') not in('A','B','C') |
+----------------------------------+
| 1 |
+----------------------------------+
1 row in set (0.00 sec)
解决方案 »
- SQL
- Lost connection to MySQL
- update select 的sql语句怎么写
- 我想把一列数据前全部加0,如何实现啊?
- 请问各位高手,Mysql中如何设置从指定数字开始自动增长?
- 100分,求求各位大侠帮帮忙!MySQL的查询,回答成功马上接帐!
- 刚装完windows下,也设置了root的密码,可是为什么还可以缺省地用mysql命令直接登录?
- sql句子select的使用问题~~~
- mysql中怎么实现这样的想法?
- ACCESS数据库的内容如何转入MySQL数据库?
- 关于浮点数的精度问题
- 高分求助:如何从JAVA的DatabaseMetadata类中得到某一列是否有unique key 的约束.
升级你的版本。
mysql> select binary 'a' not in ('A','B','C');
+---------------------------------+
| binary 'a' not in ('A','B','C') |
+---------------------------------+
| 1 |
+---------------------------------+
1 row in set (0.06 sec)mysql> select (binary 'a') not in ('A','B','C');
+-----------------------------------+
| (binary 'a') not in ('A','B','C') |
+-----------------------------------+
| 1 |
+-----------------------------------+
1 row in set (0.00 sec)
mysql> select left(version(),3);
+-------------------+
| left(version(),3) |
+-------------------+
| 5.1 |
+-------------------+
1 row in set (0.02 sec)