开发者

Search memo field using space-separated keywords?

given the following test records

ID, MemoField

1, "apples oranges mangoes peaches"

2, "oranges bananas apples"

3, "oranges plums cherries"

4, "bananas cherries kiwi"

and having keywords entered in a single text field as: "apples oranges"

I want to be able to return records 1, 2 and 3 because those recor开发者_运维问答ds either contain apples or oranges....

I want to assume that spaces in the list of keywords imply an OR.

How can I write a safe, parameterized query to make this happen? I was thinking of taking the keywords, splitting them and generating clauses for each of the words and OR-ing them, but that doesn't seem efficient especially as the list of keywords get longer....

I'm really at a loss, please help.

Thanks, Lou


I found SQL Server Full-Text and the FREETEXT function. Hopefully this works out.

Thanks, M

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜