hello everybody.....here is my dilemna:
each entrant to a database has 10+ scores, and i need to add the 7 highest (as total).
Can I do this? I'm close i think, but i can't get this valid. Should I use SUM, COUNT, CONCAT, etc to return ONLY the top 7 values?
SELECT one_points, two_points, three_points, four_points, five_points, six_points, seven_points, eight_points
FROM table
WHERE sex = 'male'
ORDER BY total ASC
LIMIT 7
Here is an example:
field_name value
name: Bill Rodgers
one_points 100
two_points 200
three_points 29
four_point 0
five_points 700
six_points 1101
seven_points 26
eight_points 100
nine_points 4
ten_points 224
What I need to do is calculate the TOTAL of the 7 highest values from this structure.
Does that make sense?
Thanks!
-Michael