SELECT TIMESTAMPDIFF(MINUTE, pubdate, now()), id, message from message;
Messages from the last 5 minutes
You can get all messages from the last 5 minutes with the following example;
SELECT TIMESTAMPDIFF(MINUTE, pubdate, now()), id, message from message where (TIMESTAMPDIFF(MINUTE, pubdate, now()) < 5);
This method is quite handy for systems displaying live data.
6 comments:
thany you!
The query helped..
help me to solve a bug.. thanks a lot!
Hey, thanks a lot for this
thank you! good method
Thanks, finally I got here...
Post a Comment