Go to Google Groups Home    comp.databases.mysql
Select X of of Y in Aggregation

howa <howac...@gmail.com>

Consider a table like:

user_id      score
      1      90
      1      80
      1      70
      2      85
      2      80
      2      80
      .
      .

I want to select te average score of a user and will use sth
like:

SELECT avg( score )
FROM `score`
GROUP BY user_id

but sometimes, i want to select the average, but dropping the lowest N
score, how
to write the query?

thanks