oletob oletob - 7 months ago 18
SQL Question

MYSQL Match string in column

I have a text inside a column and I want to make a search within this text but with only some words, for example:


"gender:male,eye_color:blue,province:12"


How can I perform a query to match just "gender:male,province:12" in this text?

Thanks in advance

Answer

You mean this or not, just try it, I don't even know it works for your demand;)

select * from @table where @column like '%gender:male,%province:12%'
Comments