22,209
社区成员
发帖
与我相关
我的任务
分享
-- 把多个条件,存到一个临时表中吧,用这个形式
with m as (
select '124' c
union all
select '618'
)
select * from t
where exists(select * from m where t.bb like '%' + c + '%')
WHERE CONTAINS(Name, ' 条件1 OR 条件2 ')
-- 可以这样写,但是可读性不如多个 or ,效率也不 or
where bb != replace(replace(bb,'124',''),'618','')
SELECT * FROM Table1 WHERE bb LIKE '%124%' OR bb LIKE '%618%'