All pastes #248719 Raw Edit

Anonymous

public text v1 · immutable
#248719 ·published 2006-11-14 22:54 UTC
rendered paste body
mysql> SELECT TIMESTAMPDIFF(SECOND,t1.time,t2.time) AS difference FROM example AS t1, example AS t2 WHERE t1.id+1 = t2.id;
+------------+
| difference |
+------------+
| 6          |
| 1155       |
| 13         |
| 11         |
+------------+
4 rows in set (0.00 sec)

mysql> SELECT * FROM example;
+----+---------------------+-------+
| id | time                | value |
+----+---------------------+-------+
| 1  | 2006-11-14 15:31:47 | 5     |
| 2  | 2006-11-14 15:31:53 | 9     |
| 3  | 2006-11-14 15:51:08 | 9     |
| 4  | 2006-11-14 15:51:21 | 9     |
| 5  | 2006-11-14 15:51:32 | 9     |
+----+---------------------+-------+
5 rows in set (0.00 sec)