Ranking Within A Totals Query

A

Alan Balthrop

Hello, all. I posted this question several months ago but truly did
not understand the response. I apologize for asking again.


I am creating a database of soccer statistics. In this version, I am
working with a table (named "field") with statistics where each record
is the stats for a certain player ("player") for each game of the
season.

I have determined how to create a query to tell me the number of goals
a player has for the season, and rank them in decending order:


SELECT field.Player, Sum(field.G) AS Goals
FROM field
GROUP BY field.Player
HAVING (((Sum(field.G))>0))
ORDER BY Sum(field.G) DESC;

....but would like to have a column marked "rank" next to the player
column giving the ranking from one to however many (ties would not be
broken).

I am not writing the SQL code. What appeared above was what was
generated by Access 2002. Any help you could provide this complete
novice would be greatly appriciated!!!



Alan Balthrop
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

See this article in the MS KB:

Q120608: How to Rank Records Within a Query

http://support.microsoft.com/support/kb/articles/q120/6/08.asp

- --
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQEeOAoechKqOuFEgEQLkawCgkk18sHfu4r34PYOkYKjKXY5nUCgAoPKX
tenT64suRDUK25ubjqYtbKxz
=Vtoj
-----END PGP SIGNATURE-----


Alan Balthrop wrote:

...but would like to have a column marked "rank" next to the player
column giving the ranking from one to however many (ties would not be
broken).

< SNIP >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top