SUM value like 10,23,15,10
SUM value like 10,23,15,10
am 24.08.2010 15:53:16 von Tompkins Neil
--0016363b8e48438aeb048e921620
Content-Type: text/plain; charset=ISO-8859-1
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
--0016363b8e48438aeb048e921620--
Re: SUM value like 10,23,15,10
am 24.08.2010 15:56:41 von Johan De Meersman
--000e0cd58dc6799389048e92223b
Content-Type: text/plain; charset=ISO-8859-1
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
> 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
--000e0cd58dc6799389048e92223b--
Re: SUM value like 10,23,15,10
am 24.08.2010 15:58:00 von Tompkins Neil
--0016363b87022853b1048e92279d
Content-Type: text/plain; charset=ISO-8859-1
Yeah these values are held with a varchar field.
On Tue, Aug 24, 2010 at 2:56 PM, Johan De Meersman 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@googlemail.com> 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
>
--0016363b87022853b1048e92279d--
Re: SUM value like 10,23,15,10
am 24.08.2010 16:01:20 von Johan De Meersman
--0022152d61491b67ce048e92338c
Content-Type: text/plain; charset=ISO-8859-1
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
> wrote:
> Yeah these values are held with a varchar field.
>
>
> On Tue, Aug 24, 2010 at 2:56 PM, Johan De Meersman
> >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@googlemail.com> 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
--0022152d61491b67ce048e92338c--
Re: SUM value like 10,23,15,10
am 24.08.2010 16:04:06 von Tompkins Neil
--0016367d5e36fee7dd048e923c36
Content-Type: text/plain; charset=ISO-8859-1
The application is still being developed, so I will probably look at storing
it in separate tables so that it can easily be computed.
On Tue, Aug 24, 2010 at 3:01 PM, Johan De Meersman wrote:
> 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@googlemail.com> wrote:
>
>> Yeah these values are held with a varchar field.
>>
>>
>> On Tue, Aug 24, 2010 at 2:56 PM, Johan De Meersman
>> >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@googlemail.com> 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
>
--0016367d5e36fee7dd048e923c36--
Re: SUM value like 10,23,15,10
am 24.08.2010 16:11:01 von Johan De Meersman
--0016e647ed10c1e1db048e9255eb
Content-Type: text/plain; charset=ISO-8859-1
The proper way to do this would indeed be a separate table that has (itemID,
property, value) or something like that.
On Tue, Aug 24, 2010 at 4:04 PM, Tompkins Neil
> wrote:
> The application is still being developed, so I will probably look at
> storing it in separate tables so that it can easily be computed.
>
>
> On Tue, Aug 24, 2010 at 3:01 PM, Johan De Meersman wrote:
>
>> 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@googlemail.com> wrote:
>>
>>> Yeah these values are held with a varchar field.
>>>
>>>
>>> On Tue, Aug 24, 2010 at 2:56 PM, Johan De Meersman
>>> >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@googlemail.com> 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
>>
>
>
--
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel
--0016e647ed10c1e1db048e9255eb--