Hello,
I have an interesting problem and I cannot figure out how to solve it....
I'm using mySQL V 3.23.39 and PHP Version 4.0.3pl1...
I have a table like this:
id pts
1 450.001 444.65
1 0.00
1 450.00
1 316.16
1 0.00
1 383.65
1 0.00
I need to be able to dynamically sum only the 4 greatest values in the table. The desired result would be:
id pts
1 1728.30
I also have an enum column in the table that could be set to 'Y' for the four greatest values, but I can't event figure out how to do that without resorting to some Perl outside of mySQL.
Any ideas are welcomed...