joined:May 2, 2004
I'm just wondering if this is possible (I'm doubtful though).
row start_datetime(datetime) end_datetime(datetime)
1 2012-02-06 08:00:00 2012-02-06 19:00:00
2 2012-02-07 08:00:00 2012-02-07 20:00:00
Is it possible to query based on time difference between end_datetime row 1 and start_datetime row 2
i.e. SELECT * FROM table WHERE difference between end_datetime and start_datetime > 24 hrs (or other time)
I have been selecting multiple rows with the DATE_SUB(UTC_DATE(),INTERVAL 2 WEEK) and then looping through the result calculating the difference as I go but I'm trying to find a better way.