php - time difference between two rows - mysql -


i wanted know if there way can calculate time difference between 2 rows. want calculate time difference name -> test etc. name can in order.

i want know if test has 2 times @ row 1 , 3 , @ row 7 , 11, can calculate time difference between these rows? i.e row 1 , 3, , other row 7 , 11.

below image database

enter image description here

try using timediff() , subquery

select timediff((select `entered_at` `demo_test3` `id`='1'),                (select `entered_at` `demo_test3` `id`='3')) 

Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -