select idfrom contacts where name like '%陈%' or telephone=‘%陈%’and id='1'
这个SQL语句为什么检索不出来数据呢? 表中有一记录如下: 
id  name  telephone  email re 
1   陈三  12345
2   陈三  56789除id为int外,其它都为varchar,为什么这句SQL检索不出来数据呢? 

解决方案 »

  1.   

    select idfrom contacts where (name like '%陈%' or telephone=‘%陈%’)and id='1' 
    你改成这样的试试
      

  2.   

    select idfrom contacts where (name like '%陈%' or telephone=‘%陈%’)and id='1' 
      

  3.   

    select idfrom contacts where name like '%陈%' and id='1'  
     or后面根本就用不上  
      

  4.   

    select idfrom contacts 这是什么,表名呢,表中字段呢。
    telephone=‘%陈%这又是什么,哎,看不懂。
      

  5.   

    select idfrom contacts where name like '%陈%' or telephone=‘%陈%’and id='1' 
    id和from写在一块了,‘%陈%’这个地方的单引号应该用英文输入法下的吧,你的id是什么类型的啊,整型的不应该用单引号引起来吧。。
      

  6.   

    select id from contacts where id='1' and (name like '%陈%' or telephone like '%陈%')