select * from mytbl2 where c1 like '%A%'
union 
select * from mytbl2 where c1 like '%B%'

解决方案 »

  1.   

    select * from mytbl2 
    where (c1 like '%A%') and (c1 like '%B%')
      

  2.   

    应该是:
    select * from mytbl2 
    where (c1 like '%A%') or (c1 like '%B%')
      

  3.   

    你的要求是同时出现 A 、B的记录呢还是带A 的记录和带B 的所有记录
    要是前者( WangZWang(阿来) )
    select * from mytbl2 
    where (c1 like '%A%') and (c1 like '%B%')
    要是后者
    select * from mytbl2 
    where (c1 like '%A%') or (c1 like '%B%')select * from mytbl2 where c1 like '%A%'
    union 
    select * from mytbl2 where c1 like '%B%'
      

  4.   

    采用
    select * from mytbl2 
    where (c1 like '%A%') or (c1 like '%B%')谢谢各位,明白了