Home All Groups Group Topic Archive Search About

Need to calculate a weighted average using sql

Author
29 Jun 2006 4:28 PM
JMainus
Help!!!  I'm in a time crunch and need to calculate a weighted average. 
Example:  85% of players will win $10.00, 5% will win $100.  I have a table
that is storing the counter information.  I just drawing a blank!!!

Any help is appreciated!!!

Author
29 Jun 2006 5:03 PM
Alejandro Mesa
JMainus,

Can you provide some DDL, sample data and expected result?


AMB

Show quote
"JMainus" wrote:

> Help!!!  I'm in a time crunch and need to calculate a weighted average. 
> Example:  85% of players will win $10.00, 5% will win $100.  I have a table
> that is storing the counter information.  I just drawing a blank!!!
>
> Any help is appreciated!!!
Author
29 Jun 2006 6:25 PM
JMainus
Alejandro,
    I have a table that is storing the amounts available; $10, $20, $50 and
also the number of available awards per amount, and the percentage field
stores the weighted average;  ex.  85% can win $10.

Thanks for your help.

Show quote
"Alejandro Mesa" wrote:

> JMainus,
>
> Can you provide some DDL, sample data and expected result?
>
>
> AMB
>
> "JMainus" wrote:
>
> > Help!!!  I'm in a time crunch and need to calculate a weighted average. 
> > Example:  85% of players will win $10.00, 5% will win $100.  I have a table
> > that is storing the counter information.  I just drawing a blank!!!
> >
> > Any help is appreciated!!!
Author
30 Jun 2006 1:11 PM
--CELKO--
Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, data types, etc. in
your schema are. Sample data is also a good idea, along with clear
specifications.  It is very hard to debug code when you do not let us
see it.

AddThis Social Bookmark Button