MySQL Forums
Forum List  »  Newbie

search comma separated db column
Posted by: Jon Hollis
Date: April 24, 2008 03:33PM

I need a query string to search a column that contains a comma separated list of integers.

I've got this:

SELECT * FROM `jos_content` WHERE cat_tag LIKE '%57%'

Which is fine until I need to pull out results with numbers less than ten. For example, if I need to search for instances of "7", I could get anything that contains 57 or 27 or 7 etc. I want to search for the number esplicitly, all of it, the whole number, nothing greater or smaller.

Maybe the answer lies with IN or FIND_IN_SET but I can't get these to work.

Options: ReplyQuote


Subject
Written By
Posted
search comma separated db column
April 24, 2008 03:33PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.