![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have table structure like below. Each row is one played game, each person can play many or none times in each month. id | person | score | date | ------------------------------------ 1 | 32 | 444 | 2011-05 | 2 | 65 | 528 | 2011-05 | 3 | 77 | 455 | 2011-05 | 4 | 32 | 266 | 2011-06 | 5 | 77 | 100 | 2011-06 | 6 | 77 | 457 | 2011-06 | 7 | 77 | 457 | 2011-06 | 8 | 65 | 999 | 2011-07 | 9 | 32 | 222 | 2011-07 | I am trying to get for each person sum of its best score in each month. SELECT person, date, MAX(score) as 'sc' FROM tabgames WHERE MONTH(date) = 6 GROUP BY person HAVING (sc>0) |
|
Because i need in the end results of sum of max at quarter of year, |
|
Now i am reading about group-wise max and still try to get excpected results. |
![]() |
| Thread Tools | |
| Display Modes | |
| |