Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql search keyword

Status
Not open for further replies.

rsshetty

Programmer
Dec 16, 2003
236
US
I have a string of keyword
eg, "stored,procedure,daily"

I have a table with a column "Keywords":
ID Keywords
---------------
1 stored,daily
2 procedure
3 daily
4 business, query
5 logic, daily

I want to be able to pull up rows with id 1,2,4 and 5 on matching the keyword string with the Keyword column of the table.
Any ideas on the best way to do it.

rsshetty.
It's always in the details.
 
Should the IDs not be 1,2,3 and 5 and not 1,2,4 and 5?

Seems like 4 does not have any of the keywords that are in your string.

Thanks

J. Kusch
 
If you change your table to

1 stored
1 daily
2 procedure
...
Then it becomes easy.
If you can't do that then I would suggest using a temp table with that structure.
Do the same thing to the input string and the query is simple.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
JayKusch,
You are right. It should be 1,2,3 and 5



rsshetty.
It's always in the details.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top