MySQL Forums
Forum List  »  Newbie

Re: Delete rows within a given time interval
Posted by: Jesús Uzcanga
Date: May 18, 2018 08:55AM

Wow this is interesting...

For sure you can resolve this using INTERVAL function.

A quick example is:

SELECT * FROM tbl
WHERE tbl.mydate > DATE(DATE_sub(NOW(), INTERVAL 30 MINUTE))
AND tbl.mydate < DATE(DATE_sub(NOW(), INTERVAL 30 MINUTE));

This will show you everything 30 minutes in the past and 30 minutes in the future so probably could help as a start point.

___________________________
Ing. Jesús Alfredo Uzcanga
Twitter: @JesusUzcanga

We learn the 20% of what we HEAR,
the 50% of what we SEE,
the 80% of what we DO and
the 95% of what we TEACH.

____________________________________________________________
https://www.linkedin.com/in/jauzcanga/

Options: ReplyQuote


Subject
Written By
Posted
Re: Delete rows within a given time interval
May 18, 2018 08:55AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.