Using MySQL and I have data being loaded into a table every second. I want to just see the latest x mins (10, 15, whatever I want). Everything I’ve read says to use INTERVAL and this works in the MySQL query editor BUT I’m querying the table from .NET and the exact same query doesn’t seem to work from the .NET driver when using INTERVAL. How can I do this without using the INTERVAL keyword?
Share
It’s kind of nasty, but you can also use ADDTIME() with a negative value:
SELECT * FROM table WHERE date_col > ADDTIME(NOW(), ‘-0:5:0’);