How to get from the table those messages whose id is greater than lasMessageID?

I have a table in my database that has an id and a message. How to take from the table those messages whose id is greater than lasMessageID, where lasMessageID is the id of one message of the type I don’t know anyway
SELECT message FROM messages WHERE id > lasMessageID


Answer 1

Don’t bother yourself, add a time column to the table and set the type to timestamp and the latest posts will be selected