Tuesday, February 14, 2012

Breakdown database by percent

I am in the Casino industry and would like to break down our database by
percent of win. For example:
lets say we have 100,000 rated players. I want to find the win the top 1%
of players contribute followed by
2%
3%
4%
.
.
100%
My fields are Player_ID, Win.
I need help writing a procdure to group/calculate this for me. The database
grows automatically so the procudre needs to automatically adjust based on
the growth.
ThanksI don't think I understand your question fully but on it's surface
it sounds like you can benefit from the TOP keyword in your
SELECT.
SELECT TOP n [PERCENT]
See BOL for more details
<brian.shannon@.diamondjo.com> wrote in message
news:OaRnZCgFFHA.2156@.TK2MSFTNGP09.phx.gbl...
> I am in the Casino industry and would like to break down our database by
> percent of win. For example:
> lets say we have 100,000 rated players. I want to find the win the top 1%
> of players contribute followed by
> 2%
> 3%
> 4%
> .
> .
> 100%
> My fields are Player_ID, Win.
> I need help writing a procdure to group/calculate this for me. The
database
> grows automatically so the procudre needs to automatically adjust based on
> the growth.
> Thanks
>|||>> I need help writing a procdure to group/calculate this for me.
Sure, it is easy, but many here won't have the inclination to create sample
tables, insert sample data & write up a query for you when you did not
bother to post required information for others to repro the problem. Read
www.aspfaq.com/5006 & provide table structures, sample data & expected
results so that others can suggest a tested solution.
Anith

No comments:

Post a Comment