List:General Discussion« Previous MessageNext Message »
From:Duncan Hill Date:January 28 2004 9:03am
Subject:Re: Select older than minutes
View as plain text  
On Wednesday 28 January 2004 06:00, Scott Haneda wrote:
> I have done this so many times..
> SELECT * FROM `support_start` WHERE TO_DAYS(NOW()) - TO_DAYS(date) > 7
>
> I have scoured (more like glanced :-)) at the docs on
> <http://www.mysql.com/doc/en/Date_and_time_functions.html> and can not seem
> to find how to get all records where a timestamp(14) is older than x
> minutes.

You haven't said which version of MySQL you're using.

That said:
DATE_SUB.

select * from support_start where time_stamp_field > date_sub(now, interval x 
minute);

Sub for time_stamp_field and x as needed.
Thread
MYSQL SecurityTimotius Alfa28 Jan
  • Select older than minutesScott Haneda28 Jan
    • RE: Select older than minutesDonny Simonton28 Jan
    • Re: Select older than minutesDuncan Hill28 Jan
      • Re: Select older than minutesScott Haneda28 Jan
  • Re: MYSQL SecurityMikhail Entaltsev28 Jan
  • Re: MYSQL SecurityVictoria Reznichenko28 Jan
    • Re: MYSQL SecurityTimotius Alfa29 Jan