标签: mysql
我有这两行:
id value created 1 10 2012-01-05 2 12 2012-02-13
如何找到这两个连续记录之间的天数(基于其创建的字段)?
谢谢!
答案 0 :(得分:3)
MySQL的DATEDIFF功能应该有帮助
SELECT DATEDIFF(a.created,b.created) FROM table a, table b WHERE a.id = 1 AND b.id = 2