List:General Discussion« Previous MessageNext Message »
From:Johan De Meersman Date:August 24 2010 2:01pm
Subject:Re: SUM value like 10,23,15,10
View as plain text  
Then you're pretty much on your own, I'm afraid. Not a very good way to
store data :-)

You could maybe build a stored procedure, or do it in the app; but it's
gonna be code either way.

On Tue, Aug 24, 2010 at 3:58 PM, Tompkins Neil <neil.tompkins@stripped
> wrote:

> Yeah these values are held with a varchar field.
>
>
> On Tue, Aug 24, 2010 at 2:56 PM, Johan De Meersman <vegivamp@stripped
> >wrote:
>
> > If you're looking at the string "10,23,15,10" in a single field, you'll
> > have to do it the hard way. If you have an int field, and four rows with
> > those values, you can do a group by that field and select the count() of
> it.
> >
> >
> > On Tue, Aug 24, 2010 at 3:53 PM, Tompkins Neil <
> > neil.tompkins@stripped> wrote:
> >
> >> Hi
> >>
> >> In MySQL is it possible to SUM a field which contains like 10,23,15,10.
> >>  The
> >> result I'd be looking for is
> >>
> >> 10 = count of 2
> >> 23 = count of 1
> >> 15 = count of 1
> >>
> >> Cheers
> >> Neil
> >>
> >
> >
> >
> > --
> > Bier met grenadyn
> > Is als mosterd by den wyn
> > Sy die't drinkt, is eene kwezel
> > Hy die't drinkt, is ras een ezel
> >
>



-- 
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel

Thread
SUM value like 10,23,15,10Tompkins Neil24 Aug
  • Re: SUM value like 10,23,15,10Johan De Meersman24 Aug
    • Re: SUM value like 10,23,15,10Tompkins Neil24 Aug
      • Re: SUM value like 10,23,15,10Johan De Meersman24 Aug
        • Re: SUM value like 10,23,15,10Tompkins Neil24 Aug
          • Re: SUM value like 10,23,15,10Johan De Meersman24 Aug