表驱动WHERE子句使用LIKE

时间:2012-01-20 03:15:05

标签: sql-server-2008 where-clause sql-like

我有什么:

WHERE (dbo.Field1 LIKE '% contact made %' OR dbo.Field1 LIKE '% talked to %')

我需要以下内容:

WHERE (dbo.Field1 LIKE IN (SELECT Pattern FROM PatternTable))

PatternTable
------------
% contact made %
% talked to %
% called in %
% spoke with %
% spoke to %

类似的问题是SQL Where Clause with LIKE and IN

2 个答案:

答案 0 :(得分:3)

在Oracle中你可以做到

SELECT * FROM dbo
JOIN PatterTable ON dbo.Field LIKE PatterTable.pattern

我认为这也适用于SQL Server。

答案 1 :(得分:0)