Search for string within text column in MySQL

Posted by user94154 on Stack Overflow See other posts from Stack Overflow or by user94154
Published on 2010-03-26T21:10:06Z Indexed on 2010/03/26 21:13 UTC
Read the original article Hit count: 153

Filed under:
|
|
|

I have mysql table that has a column that stores xml as a string. I need to find all tuples where the xml column contains a given string of 6 characters. Nothing else matters--all I need to know is if this 6 character string is there or not.

So it probably doesn't matter that the text is formatted as xml.

Question: how can I search within mysql? ie SELECT * FROM items WHERE items.xml [contains the text '123456']

Is there a way I can use the LIKE operator to do this?

Thanks

© Stack Overflow or respective owner

Related posts about mysql

Related posts about like