mysql - How to get total time in sql -


good day, need though have looked/searched other question mine it's not looking for. that want total time kind of data format. have tried getting total date query:

select datediff(max(date(in_out)), min(date(in_out))) datediffs,  `tbl_tmpdtr` userid = 1002 

and needed, want total time , have tried far query:

select max(time(in_out))-min(time(in_out)) minus `tbl_tmpdtr` date(in_out) = '2015-05-01' 

but result whole number this:

minus 90000 

what missing? or lacking. want query total time date='2015-05-01'. after achieving that, total time id=1002.

i have data in database(mydb) table(tbl_tmpdtr):

id  |  userid  |  in_out             |  status 1   |  1002    | 2015-05-01 09:00:00 |  in 2   |  1002    | 2015-05-01 18:00:00 |  out 3   |  1002    | 2015-05-02 09:00:00 |  in 4   |  1002    | 2015-05-02 18:20:00 |  out 5   |  1002    | 2015-05-03 09:30:00 |  in 6   |  1002    | 2015-05-03 18:10:00 |  out 


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -