I`ve got MySQL table with such columns: comment_id, comment_content, comment_date, comment_author. I need to get 10 latest comments which have unique comment_author. This query:
SELECT comment_content, comment_date, comment_author
FROM comments
GROUP BY comment_author
ORDER BY comment_date DESC
LIMIT 10
doing almost what i need, but it takes 1 oldest comment from each unique author, but i need the latest one. Tried to use GROUP BY comments_author HAVING MAX(comment_date) but nothing changed. Thank you.