how to show the last 5 rows of my MySQL table sorted by ID. For example, I have a table with 15 records. I want to get IDs 10, 11, 12, 13, 14 and 15. In that order. From low to high.
SELECT * FROM temperaturas ORDER BY id DESC LIMIT 5;
Thus, I get ID 15, 14, 13, 12, 11 and 10. They are the last, but ordered back.
source share