sql - Sum of time difference between multiple Mysql rows with changing filters -
I have a hard time finding a suitable SQL query that is the difference of the difference between several rows based on user filter It is mainly set on the form written in PHP.
The structure is:
Date time number Action 2011-08-09 09:11:16 12S 2014-08- 09 09:12:21 12T 2014- 08-09 09:16:59 12s 2014-08-09 09:17:16 12T 2014-08-09 09:17:28 12S 2014-08-09 09:17:17 44JG 2014-08- 09 09:21:30 12 T 2014-08-09 09:21:42 12S 2014-08-09 09:36:08 12S 2014-08-09 09:37: 08 12b 2014-08-09 09 : 38: 19 12T 2014-08-09 09:39:53 12A 2014-08-09 09:42:05 12S
Database is mysql, approximately 8000 rows per day Are inserted, currently there are approximately 1,500,000 rows, users need to find the amount of time between certain lines For example, the amount of time between the lines where AA = S and the action B = T. In that specific case the time difference will be four rows, which will be added. Users can filter on each column.
There is an idea of syntax for any person to use for the right time abstract, the fastest (or nearly) as possible?
Comments
Post a Comment