I'm writing you today because I'd like to know how to manage the following!
An example table:
NAME, PRIORITY, SORT
TEST1, 0, 11:10
TEST2, 1, 11:15
TEST3, 0, 11:20
TEST4, 1, 11:30
priority
Please try this.
SELECT NAME
FROM table
WHERE PRIORITY = 1
ORDER BY TIME ASC
LIMIT 1
UNION
SELECT NAME
FROM table
ORDER BY TIME ASC
that should gave
TEST2 (first submitted with priority) TEST1 TEST3 TEST4
edit forgot priority