现在数据库里 
A字段数据为:0.1.2.3.4 
B字段数据为:5.6.7.8.9用户输入1 和 2  
那就是查找 1 是否在A字段中
           2 是否在B字段中各位老大,这样的查询语句 怎么写的!~  我写的模糊搜索一直有问题,就是 用户输入1 ,如果A字段里有1和11都作为结果给找出来了!~

解决方案 »

  1.   

    select * from tablename where A字段 like '1%' or B字段 like '2%'
      

  2.   

    1
    11=
    like1=1
    11 like '1%'
      

  3.   


    adoquery1.SQL.Add('select * from table where A like "'+edit3.Text+'%" and B like "'+edit6.Text+'%" and C like "'+edit9.Text+'%"');
    什么都查不出来!字段A:0.1.2.3.4.5
    字段B:0.1.2.4.6
    字段C:7.8.9.10.11
      

  4.   

    换了一个 帖子   见:http://topic.csdn.net/u/20110511/10/b03f4168-c72d-4040-859f-e2502b6983e2.html这个帖子 我结掉!~