Use a subquery here to get the final reverse ordering you want:
SELECT *FROM( SELECT * FROM comments WHERE chat_id = 1 ORDER BY comment_id DESC -- last 10 rows LIMIT 10) tORDER BY comment_id; -- in ascending order
Use a subquery here to get the final reverse ordering you want:
SELECT *FROM( SELECT * FROM comments WHERE chat_id = 1 ORDER BY comment_id DESC -- last 10 rows LIMIT 10) tORDER BY comment_id; -- in ascending order