我有以下查询
SELECT a.id AS productId, b.*
FROM #__something AS a
LEFT JOIN #__somthingElse AS b
ON a.id=b.product_id AND b.accept=1 AND b.user_id = 12
WHERE a.id IN (95,86,85)
我得到以下
85 ........... first
85 ........... second time same id
85 ........... last same id
86 ...........
95 ........... first
95 ........... last same id
使用'GROUP BY a.id'我只按每个id获得第一行。
我怎么才能得到最后一个?
提前致谢