我现在问题就是用select * from countries where countries_code='86' 查不出结果

解决方案 »

  1.   

    还有个更怪的,如果我把86改为860再用select * from countries where countries_code='860' 和select * from countries where countries_code=860都查得结果了
      

  2.   

    mysql> create table test(
        -> test varchar(10)
        -> )Type=MyISAM;
    Query OK, 0 rows affected (0.05 sec)mysql> insert into test values ('86');
    Query OK, 1 row affected (0.02 sec)mysql> select * from test where test=86;
    +------+
    | test |
    +------+
    | 86   |
    +------+
    1 row in set (0.08 sec)mysql> select * from test where test='86';
    +------+
    | test |
    +------+
    | 86   |
    +------+
    1 row in set (0.00 sec)
      

  3.   

    我的数据库 verchar字段
    select * from mytable where field3>"a";
    数字的话可以
    select * from mytable where field2>1;
    也可以select * from mytable where field2>"1";