Thats Great!

Thanks a Ton!


:)




On Mon, Jul 6, 2009 at 7:55 PM, Dan Nelson <dnel...@allantgroup.com> wrote:

> In the last episode (Jul 06), avrom...@whyisitthat.com said:
> > From: "Highviews" <highvi...@gmail.com>
> > > I have numbers separated with commas saved into a TEXT Field, for
> > > example:
> > >
> > > ROW1: 10,5,2,8,
> > > ROW2: 2,7,9,65
> > > ROW3: 99,100,55,10,88,
> > > etc...
> > >
> > > Now i want to make a query like this:
> > > SELECT * FROM table where numbers LIKE '%8%';
> > >
> > > Any solution to this?
> > > I only want exact numbers to be searched out.
> >
> > It's ugly, but this should work:
> >
> > SELECT * FROM table where numbers LIKE '8,%' or  numbers LIKE '%,8,%' or
> > numbers LIKE '%,8'
>
> Even better:
>
>  SELECT * FROM table WHERE find_in_set('8',numbers);
>
>
> http://dev.mysql.com/doc/refman/5.1/en/string-functions.html#function_find-in-set
>
>
> --
>        Dan Nelson
>        dnel...@allantgroup.com
>

Reply via email to