日期:2014-05-18 浏览次数:20462 次
--try select * from [table] where letter in ('a','b','c')
------解决方案--------------------
select * from [table] where patindex('%[a b c]%',letter)> 0
------解决方案--------------------
declare @t table (id int,letter varchar(20)) insert into @t select 1,'a' union all select 2,'b' union all select 3,'c' union all select 4,'d' union all select 5,'a' union all select 6,'e' --方法一 select * from @t where letter in ('a','b','c') --方法二 select * from @t where letter='a' or letter='b' or letter='c'