I have these two rows:
id value created
1 10 2012-01-05
2 12 2012-02-13
How do i find the number of days in between these two consecutive records (based off of their created field)?
Thanks!
I have these two rows:
id value created
1 10 2012-01-05
2 12 2012-02-13
How do i find the number of days in between these two consecutive records (based off of their created field)?
Thanks!
MySQL's DATEDIFF function should help
SELECT DATEDIFF(a.created,b.created)
FROM table a,
table b
WHERE a.id = 1
AND b.id = 2