Monday, 12 August 2013

Mysql select records having difference of 36 hours or less

Mysql select records having difference of 36 hours or less

I have a table:
ID DATE
1 2013-08-12 08:59:16
2 2013-08-13 08:59:16
3 2013-08-14 08:59:16
4 2013-08-17 08:59:16
I want to select those records where difference of dates is within 36
hours of each other, not the current date
In the example above, the dates on the 12th and 13th is one case and 13th
and 14th is another.
Sorry if question not clear, but its for purely mysql

No comments:

Post a Comment