select (Col_Name)
where (Col_Name) not like '%abc%'
and (Col_Name) not like '%cap%'
and (Col_Name) not like '%tis%'
and (Col_Name) not like '%sat%'
and (col_Name) not like '%plk%'
答案 0 :(得分:3)
SQL Server本身不支持正则表达式,但您可以安装CLR函数来使用它们。
实现这一目标的一种方法是
SELECT *
FROM YourTable
WHERE col_Name IS NOT NULL AND
NOT EXISTS (SELECT *
FROM (VALUES ('abc'),
('cap'),
('tis'),
('sat'),
('plk')) V(C)
WHERE col_Name LIKE '%' + C + '%')
虽然我认为这不是一种改进。