Avatar of skij
skij
Flag 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?
Microsoft SQL Server

Avatar of undefined
Last Comment
skij

8/22/2022 - Mon
SOLUTION
Scott Pletcher

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
skij

ASKER
@Scott Pletcher: your idea returns a syntax error.

I need a solution that actually works.
Scott Pletcher

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
skij

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
skij

ASKER
Each term needs its own FORMSOF() statement.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck