select *,datediff(ss,(select max( CreateTime) from Table1 b where b.id<a.id),a.CreateTime)from Table1 a
Table1表有自增长字段Id
Table表的CreateTime也是随着Id而增大的