select id from dcr_hao where haono='1000000000547001 198953273313'
这样的  怎么查询不到?
数据库里有这条记录啊  是不是有空格的原因 ?

解决方案 »

  1.   

    你看看haono字段里是不是前后有空格啊,在数据库里也检查一下。
      

  2.   


    select id from dcr_hao where haono='1000000000547001 198953273313' 
    --查不到数据是因为你的haono字段没有等于1000000000547001 198953273313的值和空格没关系的
      

  3.   

    desc dcr_hao ;看一下你的表结构。如果确定你的 haono 是字符型,则select id , haono from dcr_hao where haono like '1000000000547001%';贴出来看一下。估计是根本没有符合条件的记录。
      

  4.   

    select id from dcr_hao where haono='1000000000547001 198953273313'
    where 条件后面的`haono`这个字段你没有select 出来
    这么写:
    select id, haono from dcr_hao where haono='1000000000547001 198953273313'
      

  5.   

    select id, haono from dcr_hao where haono='1000000000547001 198953273313'