This seems like such a simple problem, but I seem to be going around in circles. I have a View which has the following fields :
What I want is to get a list of attemptid s for the maximum total_percent per user with a filter on started. I will then be constucting a result based on that list of IDs.
As soon as I include attemptid in the output, I get multiple records per user:
SELECT MAX(Total) AS Expr1, attemptid, userid
WHERE (started < '16 jun 2011')
GROUP BY userid, attemptid
This seems so simple and I am embarrassed to be asking :) Any help appreciated.