CONTAINSTABLE /全文搜索

时间:2011-08-01 07:16:18

标签: tsql full-text-search

SELECT DISTINCT CP.* FROM ContentPack CP
    INNER JOIN [Content] C ON CP.ContentPackId = C.ContentPackId

 INNER JOIN
     CONTAINSTABLE([Content],Title, [Description],
                    'How can I make my own beers and ales') AS KEY_TBL
     ON C.Title = KEY_TBL.[KEY]

在这里,我尝试搜索表内容并从ContentPack表中返回与搜索匹配的记录

但无法将其置于CONTAINSTABLE

的正确语法中

1 个答案:

答案 0 :(得分:0)

试试这个:

SELECT DISTINCT CP.* FROM ContentPack CP
    INNER JOIN [Content] C ON CP.ContentPackId = C.ContentPackId

 INNER JOIN
     CONTAINSTABLE([Content], (Title, [Description]),
                    'How can I make my own beers and ales') AS KEY_TBL
     ON C.Title = KEY_TBL.[KEY]