SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    Michigan
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    selecting records, then summing parts of a column, then sorting by that column...

    Hi,

    Iím keeping track of baseball stats, and each row represents one line of stats (from a box score) for one player of a single game. Because of this, a single player may have multiple rows in the table. I want to cumulate each playerís stats (so theyíll be one row per player) and display as output, which isnít a problem. Then I want sort by a certain stat, but by now Iíve already looped through the table, so I canít sort using a mySQL query at this point. I tried first putting values into an array in a previous project, but that became extremely complicated. Whatís the best way to approach this?

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    Michigan
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ahhh... GROUP BY and SUM() seem to take care of it.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •