Попробуйте это ...
Таблица и пример данных
CREATE TABLE test (
id INT(11) UNSIGNED PRIMARY KEY,
title VARCHAR(255) NOT NULL,
priority ENUM('low', 'medium', 'high') NOT NULL
);
INSERT INTO test (id, title, priority) VALUES (1, 'test', 'medium');
INSERT INTO test (id, title, priority) VALUES (2, 'test', 'high');
INSERT INTO test (id, title, priority) VALUES (3, 'test2', 'low');
INSERT INTO test (id, title, priority) VALUES (4, 'test2', 'low');
INSERT INTO test (id, title, priority) VALUES (5, 'test2', 'low');
INSERT INTO test (id, title, priority) VALUES (6, 'test', 'low');
INSERT INTO test (id, title, priority) VALUES (7, 'test3', 'low');
INSERT INTO test (id, title, priority) VALUES (8, 'test3', 'high');
INSERT INTO test (id, title, priority) VALUES (9, 'test3', 'medium');
Запрос
SELECT Max(t2.id) AS ID,
t1.title AS Title,
t1.priority AS Priority
FROM (SELECT title,
Min(priority) AS priority
FROM test
GROUP BY title
ORDER BY Field(priority, 'high', 'medium', 'low')) t1
INNER JOIN test t2 using (title, priority)
GROUP BY t1.title,
t1.priority;
выход
+-----+--------+----------+
| ID | Title | Priority |
+-----+--------+----------+
| 2 | test | high |
| 5 | test2 | low |
| 8 | test3 | high |
+-----+--------+----------+