I have a mysql table with data connected to date and time. Each row has data and a date, like this:
datetime name
2009-06-25 10:00:00 jhon
2009-06-25 10:00:05 jack
2009-06-25 10:00:11 json
2009-06-25 10:00:15 jack
My problem is I need to get the rows different second date1 and date2 like this :
datetime name second
2009-06-25 10:00:00 jhon 0
2009-06-25 10:00:05 jack 5
2009-06-25 10:00:11 json 6
2009-06-25 10:00:15 jack 4
Thank you