1. We have moved to a new forum! There may be a few things not working properly so please let us know if you find a bug. Remember to use the bbCode [ sql ] tag for SQL statements.

List players by numbers of points?

Discussion in 'SQL - Questions and Answers' started by alexfr, May 24, 2006.

  1. alexfr New Member

    Dialect: MySQL
    List players by numbers of points (descending, so the best is at the top) and from oldest to youngest (if 2 players have same number of points, the oldest would be first).
  2. alexfr New Member

    Dialect: MySQL
    SQL:
    SELECT p.lastname, p.firstname, SUM(r.value) AS Total, MAX( r.value) AS Maximum, p.birthdate 
    FROM player p INNER JOIN Resuls r ON p.id_player = r.id_player
    GROUP BY p.lastname, p.firstname, p.birthdate , p.id_player ORDER BY Total DESC, Maximum DESC, birthdate ASC

Share This Page