MSISDN createtime closetime
138 2011-5-17 15:30:00:000 2011-5-17 15:30:00:530
138 2011-5-17 15:40:00:000 2011-5-17 15:40:00:530
How much time does it take to query the number 138 using the SQL statement?
===============================================
Select SUM (DateDiff (Millisecond,createtime, Closetime)) as total Hao seconds from table name where msisdn=138
Select SUM (DateDiff (Minute,createtime, Closetime)) as total number of seconds from table name where msisdn=138
Select SUM (DateDiff (Minute,createtime, Closetime)) as total minutes from table name where msisdn=138
Select SUM (DateDiff (Hour,createtime, Closetime)) as total hours from table name where msisdn=138
Select SUM (DateDiff (Day,createtime, Closetime)) as Total days from table name where msisdn=138
Select SUM (DateDiff (Week,createtime, Closetime)) as Total days from table name where msisdn=138
Select SUM (DateDiff (Month,createtime, Closetime)) as Total days from table name where msisdn=138
Select SUM (DateDiff (Quarter,createtime, Closetime)) as total number of seasons from table name where msisdn=138
Select SUM (DateDiff (Year,createtime, Closetime)) as total number of years from table name where msisdn=138
SQL statement to find the time difference. such as the following data