比如我想查找111是否在表Table中的ID中

解决方案 »

  1.   

    select ID from table where id=111
      

  2.   

    select ID from Table where ID = 111
    如果有这条记录就会返回ID值
      

  3.   

    select count(id) from table where id=111
      

  4.   

    select count(1) where id=@id;>0存在
      

  5.   

    select id from table where( id=111) and where (select count(id) from table( where id=111)<>0)
      

  6.   

    大错了,是这个:
    select id from table where( id=111) and  ((select count(id) from table( where id=111))<>0)
      

  7.   

    楼主要找的是明确存在的吗?那就
    select count(1) from table where id=111
    如果是模糊查找就要用like了
      

  8.   

    查询语句select fieldvalue from table where field = fieldvalue