Link to home
Start Free TrialLog in
Avatar of skij
skijFlag for Canada

asked on

MS SQL CONTAINSTABLE() - Must Contain Both Words

This does not return any results even though both "red" and "yellow" are found because the exact phrase "red and yellow" is not found:

INNER JOIN CONTAINSTABLE(ipm_asset, *, 'FORMSOF(THESAURUS, "red AND yellow")')

Open in new window


How can I use CONTAINSTABLE so that both the words "red" and "yellow" are found in any order or position?
SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of skij

ASKER

@Scott Pletcher: your idea returns a syntax error.

I need a solution that actually works.
Did you complete the JOIN syntax??  You left the JOIN "hanging" -- no table alias for the CONTAINSTABLE and no ON clause for the JOIN -- on your initial post so I didn't know how to complete it, but it cause a syntax error if left hanging.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of skij

ASKER

Each term needs its own FORMSOF() statement.