(resent, improved format)
Hello,I have been trying some methods of querying different columns using a
2005 full text catalog.
http://technet.microsoft.com/en-gb/library/ms345119.aspx#yukonftsea_topic5
e.g.1
SELECT pk, txtCol2, txtCol3
FROM myFt_Table
WHERE CONTAINS( ( txtCol2, txtCol3 ) , ' "foo"AND"bar"')
e.g.2
CONTAINSTABLE(myFt_Table,(txtCol2,txtCol3),' "foo" AND "bar" '
Can anyone advise if it's possible to achieve something like the
following i.e. finding differnent keywords in different columns:
SELECT pk, txtCol2, txtCol3
FROM myFt_Table
WHERE CONTAINS(txtCol2, ' "foo"')
AND CONTAINS(txtCol3, ' "bar" ')
but with CONTAINSTABLE, in order to
have a join.
Thanks SOC.
Daniel Crichton - 03 Dec 2007 16:29 GMT
SOC wrote on Mon, 3 Dec 2007 11:44:40 -0000:
> Can anyone advise if it's possible to achieve something like the
> following i.e. finding differnent keywords in different columns:
> SELECT pk, txtCol2, txtCol3
> FROM myFt_Table
> WHERE CONTAINS(txtCol2, ' "foo"')
> AND CONTAINS(txtCol3, ' "bar" ')
> but with CONTAINSTABLE, in order to have a join.
How about
SELECT t.pk, t.txtCol2, t.txtCol3
FROM myFt_Table t
INNER JOIN CONTAINSTABLE(myFt_Table,txtCol2,'"foo"') AS c1 ON t.pk =
c1.[KEY]
INNER JOIN CONTAINSTABLE(myFt_Table,txtCol3,'"bar"') AS c2 ON t.pk =
c2.[KEY]

Signature
Dan