select * from mytbl2 where (c1 like '%A%') and (c1 like '%B%')
应该是: select * from mytbl2 where (c1 like '%A%') or (c1 like '%B%')
你的要求是同时出现 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%'
采用 select * from mytbl2 where (c1 like '%A%') or (c1 like '%B%')谢谢各位,明白了
where (c1 like '%A%') and (c1 like '%B%')
select * from mytbl2
where (c1 like '%A%') or (c1 like '%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%'
select * from mytbl2
where (c1 like '%A%') or (c1 like '%B%')谢谢各位,明白了