SQL Syntax Queries in MOSS Search
Hi all,
I have been asked few times for best practices on writing SQL Syntax Queries with respect to MOSS Search. There are great articles in the MOSS SDK and MSDN on best practices. In case folks are not aware of these, here are couple of quick links:
Best Practices: Writing SQL Syntax Queries for Relevant Results in Enterprise Search: https://msdn2.microsoft.com/en-us/library/bb219479.aspx
Enterprise Search SQL Syntax Reference: https://msdn2.microsoft.com/en-us/library/ms493660.aspx
Hope that helps
Mike
Comments
Anonymous
May 26, 2007
The comment has been removedAnonymous
August 20, 2008
Hi! I was wondering... SQL syntax queries are very restrictive, no? I would like to build a query with comparisons on substrings. Let me explain myself : my search must return documents that are in a SUBSITE of a site whose url is a parameter of the query. So, I can't use something like "WHERE "Path" = %url%"... (where %url% is the parameter value) I've tried with "WHERE POSITION (%url% IN "Path") > 0)", "WHERE INSTR ("Path", %url%) > 0", and even "WHERE %url% LIKE "Path"" and "WHERE "Path" LIKE %url%", but it doesn't work... I've obviously tried omitting replacing "Path" by Path, but same result... Do you know how I could do that? Thanks!Anonymous
August 20, 2008
Hi! I was wondering... SQL syntax queries are very restrictive, no? I would like to build a query with comparisons on substrings. Let me explain myself : my search must return documents that are in a SUBSITE of a site whose url is a parameter of the query. So, I can't use something like "WHERE "Path" = %url%"... (where %url% is the parameter value) I've tried with "WHERE POSITION (%url% IN "Path") > 0)", "WHERE INSTR ("Path", %url%) > 0", and even "WHERE %url% LIKE "Path"" and "WHERE "Path" LIKE %url%", but it doesn't work... I've obviously tried replacing "Path" by Path, but same result... Do you know how I could do that? Thanks!Anonymous
November 14, 2009
try this : WHERE Path LIKE 'url%'