From: Aaron Bono <postgresql@aranya.com>
To: Otniel Michael <otmic_ie@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: About Div
Date: Wed, 26 Jul 2006 09:49:25 -0500
Message-ID: <bf05e51c0607260749u43e2104di1d6aa9bd7c90bd86@mail.gmail.com> (raw)
In-Reply-To: <20060726014328.38920.qmail@web53202.mail.yahoo.com>
References: <bf05e51c0607250800p44e98ce7uea04b19ff0cf8eee@mail.gmail.com>
<20060726014328.38920.qmail@web53202.mail.yahoo.com>
On 7/25/06, Otniel Michael <otmic_ie@yahoo.com> wrote:
>
> Mr. Aaron. I am sorry, your solution didn't match in my case.
> Example for your solution :
> A = 1
> B = 1
> C = 1
> D = 1
> E = 1
> F = 1
> G = 4
>
> G have 4 candy. Its too much for G.
>
> In my case, the solution is :
> A = 1
> B = 1
> C = 1
> D = 1
> E = 2
> F = 2
> G = 2
>
> The extra candy is given to three child.
>
> Do you have the other solution? I need function in postgresql for my case.
> Because my loop is too slow.
>
> Btw thanks for your solution.
>
I think you misunderstood how to use the MOD value. 10 % 7 = 3 so the last
3 people get 1 extra, NOT the last person getting the extra 3.
But it looks like Ross got you the code to fix the problem. Check what he
provided.
==================================================================
Aaron Bono
Aranya Software Technologies, Inc.
http://www.aranya.com
==================================================================
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: postgresql@aranya.com, otmic_ie@yahoo.com
Subject: Re: About Div
In-Reply-To: <bf05e51c0607260749u43e2104di1d6aa9bd7c90bd86@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox