group by order by together code example Example: how to use order by and group by together SELECT * FROM table GROUP BY m_id ORDER BY timestamp DESC