sorry that was my mistake, the error was probably a php error in my code.
Now i'm testing your suggestions directly with mysql (using phpmyadmin) and it works better, BUT there's a problem:
If there are 2 records with the highest priority, both are returned.
Is there a way to limit that always to one?
this is the sql I'm using, slightly modified:
SELECT * FROM eventlist AS e WHERE priority =
(SELECT max(priority) FROM eventlist WHERE
eventlist.band = e.band AND eventlist.eventdate = e.eventdate)
AND eventdate = '2009-10-03' ORDER BY priority DESC, band DESC
Last, I'm not sure I understand how this query works - I imagined the secon query (SELECT MAX(...) would be processed BEFORE the other one, but can't understand how the second could refer to "e" since that should be the result of the first query....?😕 (sorry don't know if I made myself clear! 🙂