Sunday, March 25, 2012

combining containstable and freetexttable

i usetwocontainstable (one of them with 'formsof') andone freetexttable attributesin a select command and i want to combine them with the logical 'or'.

can i do this in the same command? what is the syntax?

my code :

select table1.field1,a.rank,b.rank,c.rank
from table1
containstable(table1,field,'"word"') as a
orcontainstable(table1,field,'formsof(inflectional(word)') as b)
orfreetexttable(table1,field,'word') as c
where table1.id=a.[key] and table1.id=b.[key] and table1.id=c.[key]

the above syntax is wrong. i tried',' instead of 'or'but the results were not right.

thanks

Hi,

Two containstable condition can be connected by "or". But not for containstable and freetextable. Here's the sample for each one.

select table1.field1,A.Rankfrom table1InnerJoinCONTAINSTABLE(table1,field,'("word") OR ('FORMSOF(inflectional(word))')' )as Aon table1.id = A.[key]
 
select table1.field1, C.Rankfrom table1InnerJoinFREETEXTTABLE(talbe1,field,'word')as Con table1.id = C.[key]

Thanks.

No comments:

Post a Comment