Greetings to all. Tell me, please, what am I doing wrong?
SELECT cabinet.name_test, MIN(answers.id), a1.answer_id as answer_id, a2.answer_id as answer_id2 FROM cabinet JOIN answers a1 ON a1.test_id = cabinet.test_id AND a1.user_id = '184918649' AND a1.friend_id = '353281' LEFT JOIN answers a2 ON a2.test_id = cabinet.test_id AND a2.user_id = '353281' ORDER BY answers.id
I need to sort the user responses by the minimum id field.