Wednesday, March 7, 2012

Different results from like and contains

Hi guys,
I have 2 different queries that I expected to return the same results.
Where Name like '%fish%'
and
Where contains((Name),'("*fish*")')
The first returned 181 results and the 2nd returned 178 results.
On closer inspection I determined that the Contains was not returning Names
with words that had "fish" embedded as in:
bigfishtackle.com
flyfishing
kingfisher
I thought that the *fish* would return words where fish was a suffix, prefix
or both.
What am I doing wrong?
TIA
Olaf,
Thanks for the heads-up on that information.
"Olaf Pietsch" <olaf_pietsch@.online.ms> wrote in message
news:%23iWYMNLSIHA.5164@.TK2MSFTNGP03.phx.gbl...
> Hi John,
> "John Kotuby" <JohnKotuby@.discussions.microsoft.com> schrieb im
> Newsbeitrag news:%23m1txyKSIHA.4880@.TK2MSFTNGP03.phx.gbl...
>
> The search with "*..." (leading asterisk) is not possible with contains,
> only the "...*" is possible.
> BOL says only:
> <prefix_term>
> Specifies a match of words or phrases beginning with the specified text.
> Enclose a prefix term in double quotation marks ("") and add an asterisk
> (*) before the ending quotation mark, so that all text starting with the
> simple term specified before the asterisk is matched.
> http://msdn2.microsoft.com/en-us/library/ms187787.aspx
> Many Ragards,
> Olaf
> --
> Gru Olaf
> Ich untersttze PASS Deutschland e.V. (http://www.sqlpass.de)
> Blog (http://www.sqlpass.de/PASSUserBlogs/tabid/178/Default.aspx?BlogID=3)
> Regionalgruppe Kln/Bonn/Dsseldorf
> (http://www.sqlpass.de/Regionalgruppen/KoelnBonnDuesseldorf/tabid/81/Default.aspx)
>

No comments:

Post a Comment