Krueger
Krueger

Reputation: 1228

MySQL keyword search?

I have a column in which there are two keyword google plus .How can i search from from my data base when i have the exact one word like google or plus or both of them google plus and not goo or plu.

I have tried to get to my needs with LIKE function but didn't helped.

thanks

Upvotes: 1

Views: 102

Answers (3)

craig1231
craig1231

Reputation: 3877

col LIKE '%google%' OR col LIKE '%plus%' OR col LIKE '%google plus%'

Upvotes: 0

Virendra
Virendra

Reputation: 2553

Try this:

SELECT keyword FROM tablename WHERE keyword LIKE '%google%' OR keyword LIKE '%plus%'

Upvotes: 1

duffymo
duffymo

Reputation: 309028

This isn't a good use for a relational database or LIKE. You want something like Lucene that can index values and allow you to do searches.

Upvotes: 0

Related Questions