MySQL Forums :: Newbie :: search comma separated db column


Advanced Search

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 Jon Hollis 04/24/2008 03:33PM
Re: search comma separated db column Jon Hollis 04/24/2008 03:44PM
Re: search comma separated db column hhh3h asdf 04/24/2008 05:03PM
Re: search comma separated db column Peter Brawley 04/24/2008 09:47PM
Re: search comma separated db column Jesper Öhnstedt 04/25/2008 04:15AM
Re: search comma separated db column Peter Brawley 04/25/2008 11:01AM
Re: search comma separated db column Jesper Öhnstedt 04/25/2008 12:34PM
Re: search comma separated db column Peter Brawley 04/25/2008 01:37PM
Re: search comma separated db column Jesper Öhnstedt 04/25/2008 01:48PM
Re: search comma separated db column Peter Brawley 04/25/2008 02:55PM
Re: search comma separated db column Jesper Öhnstedt 04/25/2008 03:16PM
Re: search comma separated db column Peter Brawley 04/25/2008 03:26PM
Re: search comma separated db column Jesper Öhnstedt 04/25/2008 03:46PM
Re: search comma separated db column hhh3h asdf 04/28/2008 11:41AM
Re: search comma separated db column laptop alias 04/28/2008 12:05PM
Re: search comma separated db column Dave Clark 03/31/2009 08:56PM
Re: search comma separated db column Rick James 03/31/2009 11:36PM
Re: search comma separated db column Jesper Öhnstedt 04/29/2008 01:32AM
Re: search comma separated db column Dave Clark 03/31/2009 08:55PM
Re: search comma separated db column Brian Papantonio 04/28/2008 08:08PM
Re: search comma separated db column Peter Brawley 04/28/2008 08:17PM
Re: search comma separated db column Jesper Öhnstedt 04/29/2008 12:53AM
Re: search comma separated db column hhh3h asdf 04/30/2008 12:36PM
Re: search comma separated db column Shawn Grigson 03/31/2009 08:36PM
Re: search comma separated db column Guelphdad Lake 03/31/2009 08:42PM
Re: search comma separated db column Guelphdad Lake 04/01/2009 08:07AM


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.