开发者

SQL Server Full Text Search Results differs from Like statement

开发者 https://www.devze.com 2023-01-22 05:16 出处:网络
I tried these two methods on Advantureworks and got diffe开发者_StackOverflowrent results. select * from Person.[Address] where AddressLine1 like \'%99%\'

I tried these two methods on Advantureworks and got diffe开发者_StackOverflowrent results.

  1. select * from Person.[Address] where AddressLine1 like '%99%'
  2. select * from Person.[Address] where contains(Address.AddressLine1,'"*99*"')

Any Idea?


Full text search and LIKE are two completely different things:

  • LIKE works on strings of characters and matches exactly.
  • CONTAINS works on words and is somewhat fuzzy (how the strings are broken up into word parts depends on the language and can be customized even further if needed).
0

精彩评论

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