Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Search query matching words

Avatar of Peter Nordberg
Peter NordbergFlag for Sweden asked on
Microsoft SQL ServerSQL
20 Comments1 Solution205 ViewsLast Modified:
Hi,

I have a table looking like this:
customerID int,
Organisation nvarchar
index nvarchar

The data in the index column can look something like this:
trädgård; trädgårdsmaskin;trädgårdsresa,blommor;blombukett;

If a user now searches for 'trädgård' I would like the query only to give the result those result that exactly match that word. That is, I want to be able to parse and compare each word between the ; sign. The same true if the user searches for 'trädgård' and 'blommor' I want it to exaclty match the customer that have those two words in their index column.

If I do something like this it searches the word in the whole string:

SELECT * FROM customer WHERE index LIKE '%trädgård%'

Then I get all instances that contains that word and I don't want it to compare it to each word between the ;. Is that possible and if so how can I do it.

Thanks for help!

Peter
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Commented:
This problem has been solved!
Unlock 1 Answer and 20 Comments.
See Answers