I have the following MySQL query :
Select match_static_id, comments as last_comment, max(timestamp)
from comments as c
group by match_static_id;
I have table for comment on matches and i want to have the latest comment of each match. so i use the max(timestamp) and group by (match_static_id) for that but my problem that i get the max timestamp grouped by match_static_id but i get other comment(not the comment of the max timestamp) Is my query ordered in wrong way?