0

我想使用带有 & 符号的 CONTAINS 搜索,但我可以找到虽然表中有数据。怎么用,有什么补救措施吗?

例如:

DECLARE @Author NVARCHAR(200) = N'&'

SET @Author = '"' + REPLACE(@Author, ' ', '*" and "') + '*"'

SELECT *
FROM   dbo.Taxonomy AS t (NOLOCK)
WHERE  CONTAINS(t.Author, @Author)

但没有返回结果:(

4

1 回答 1

0

尝试这个:

DECLARE @Author NVARCHAR(200) = N'"&"'

SET @Author = '"' + REPLACE(@Author, ' ', '*" and "') + '*"'

SELECT *
FROM   dbo.Taxonomy AS t (NOLOCK)
WHERE  CONTAINS(t.Author, @Author)
于 2013-08-22T12:12:32.160 回答