mardi 10 février 2015

Calculating Time Difference Between each 2 rows in SQL Server

I have db records like this,



Connected UpdatedTime
1 2015-02-05 13:13:23.420
0 2015-02-05 23:40:50.360
1 2015-02-05 23:40:50.357
0 2015-02-05 23:34:41.250


1 is when I connect external device to pc and 0 is when I disconnect it. I want to find how many seconds usb device was connected and how many seconds it was disconnected.


My Question:


Can I do that using MSSQL Query?


Aucun commentaire:

Enregistrer un commentaire