0

我希望能够在表格中搜索短语或关键字/术语的使用,并让查询返回结果,并计算该术语在每一行中使用的次数,但不一定是列。我修改了我的查询,尝试从 manager studio 中查看错误在哪里。我在“,”附近遇到错误。但无法确定原因。谢谢您的帮助。

SELECT (KEY_TBL.[KEY], FT_TBL.title, FT_TBL.url, KEY_TBL.rank, FT_TBL.html) 
FROM content AS FT_TBL INNER JOIN FREETEXTABLE (content, html, 'income tax', 25) 
AS KEY_TBL ON FT_TBL.id = KEY_TBL.[KEY] ORDER BY KEY_TBL.Rank DESC
4

1 回答 1

0

您应该查看 FREETEXTTABLE 函数,而不是 FREETEXT - 这将返回匹配相关性的排名

http://msdn.microsoft.com/en-us/library/cc879245

尝试这个

SELECT 
    KEY_TBL.[KEY], FT_TBL.title, FT_TBL.url, KEY_TBL.rank, FT_TBL.html
FROM content AS FT_TBL 
INNER JOIN FREETEXTTABLE (content, html, 'income tax', 25)  AS KEY_TBL 
    ON FT_TBL.id = KEY_TBL.[KEY] 
ORDER BY KEY_TBL.Rank DESC
于 2012-09-04T16:21:06.170 回答