MySQL 中数值比较的Bug?
mysql> select * from topic;
+----+---------------------+-------+-------------+
| id | creatDate | title | category_id |
+----+---------------------+-------+-------------+
| 1 | 2011-12-08 11:03:32 | t0 | 1 |
| 2 | 2011-12-08 11:03:32 | t1 | 1 |
| 3 | 2011-12-08 11:03:32 | t2 | 1 |
| 4 | 2011-12-08 11:03:32 | t3 | 1 |
| 5 | 2011-12-08 11:03:32 | t4 | 1 |
| 6 | 2011-12-08 11:03:32 | t5 | 1 |
| 7 | 2011-12-08 11:03:32 | t6 | 1 |
| 8 | 2011-12-08 11:03:32 | t7 | 1 |
| 9 | 2011-12-08 11:03:32 | t8 | 1 |
| 10 | 2011-12-08 11:03:32 | t9 | 1 |
+----+---------------------+-------+-------------+
mysql> select * from topic where id >= 5.5;
+----+---------------------+-------+-------------+
| id | creatDate | title | category_id |
+----+---------------------+-------+-------------+
| 7 | 2011-12-08 11:03:32 | t6 | 1 |
| 8 | 2011-12-08 11:03:32 | t7 | 1 |
| 9 | 2011-12-08 11:03:32 | t8 | 1 |
| 10 | 2011-12-08 11:03:32 | t9 | 1 |
+----+---------------------+-------+-------------+
为什么没有id为6的记录?
在Oracle中就没有这样的问题问题。
如果有这样的BUG的话.
select * from topic where id >= (select avg(id) from topic);
就肯定不行。相当于不能用avg()函数了。
有人遇见过吗?