Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
madiaz
Starting Member
2 Posts |
Posted - 2007-05-28 : 17:12:54
|
| I am developing a web site for my buddies and I to track the winnings fom my home poker games.Table that keeps track of games goes like:PlayerIDPokerGameIDcurWonI want to sort by top money maker nd show total won to dateI have tried to use:Select Distinct Sum(G.curWon) AS curCash, P.playerID FROM GameReults As G, Players As G WHERE G.PlayerID=G.PlayerID Group By G.curWon, G.PlayerIDI can not getit to sort from highet to lowest and it itrates through each record. I only want it to show distinct players and their winnings. Can you please help? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-28 : 20:51:41
|
[code]Select Distinct Sum(G.curWon) AS curCash, P.playerID FROM GameReults As G INNER JOIN Players As G PWHERE ON G.PlayerID = G P.PlayerID Group By G.curWon, G P.PlayerIDORDER BY curCash DESC[/code] KH |
 |
|
|
madiaz
Starting Member
2 Posts |
Posted - 2007-06-02 : 00:01:21
|
Thanks, that did he trick. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-06-02 : 02:13:25
|
| <<I can not getit to sort from highet to lowest and it itrates through each record. I only want it to show distinct players and their winnings. >>Becuase you didnt use Order by clauseMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|