select * from t_computer where f_updatestatustime <= 2014-07-16;
这样写查询不到值,但是: select * from t_computer where f_updatestatustime >= 2013-07-16;就可以获取到值,不知道是为什么?例如我的值是 2013-07-18 SQLselectmysql

解决方案 »

  1.   

    是日期?
    select * from t_computer where f_updatestatustime <= '2014-07-16'
      

  2.   


    嗯 我试了下 加上单引号是可以的,但是为什么 <= 的时候不加单引号也能查询到呢?
    说错了,是 >= 时不加引号也能查询到
      

  3.   

    select * from t_computer where f_updatestatustime >= 2013-07-16;就可以获取到值
    什么结果?是否正确?
      

  4.   

    明白了吧mysql> select 2013-07-16;
    +------------+
    | 2013-07-16 |
    +------------+
    |       1990 |
    +------------+
    1 row in set (0.00 sec)mysql> select 2014-07-16;
    +------------+
    | 2014-07-16 |
    +------------+
    |       1991 |
    +------------+
    1 row in set (0.00 sec)