Roberto Sha
Roberto Sha

Reputation: 1

how to search between three different values in mysql?

I have a MySql database with some data like this:

str = '554a41a6e4d9d  677  3' 

and i want to search all the values that exactly match the '677' part (the second part of text, after the first).

How i can accomplish this?

Upvotes: 0

Views: 15

Answers (2)

pavel
pavel

Reputation: 27082

If the 'parts' are delimited by space, you can use like:

SELECT [cols] FROM [table] WHERE [col] LIKE '% 677 %'

Upvotes: 1

user4795756
user4795756

Reputation:

You should use Fulltext type for the column. And then use a query like this:

SELECT * FROM table WHERE MATCH (column) AGAINST ('677');

Upvotes: 0

Related Questions