Get last n records pada MySQL


Untuk n records dapat menggunakan LIMIT pada query.

SELECT * FROM mytable
WHERE TIME(timecolumn) BETWEEN '10:20' and '11:20'
ORDER BY id DESC
LIMIT 10;

Leave a comment

Your email address will not be published. Required fields are marked *