I have a table tblSequence with 3 cols in MS SQL: ID, IP, [Timestamp]
Content could look like this:
ID IP [Timestamp]
--------------------------------------------------
4347 62.107.95.103 2010-05-24 09:27:50.470
4346 62.107.95.103 2010-05-24 09:27:45.547
4345 62.107.95.103 2010-05-24 09:27:36.940
4344 62.107.95.103 2010-05-24 09:27:29.347
4343 62.107.95.103 2010-05-24 09:27:12.080
ID is unique, there can be n number of IP's.
Would like to calculate the average time spent per IP. in a single row
Know you can do something like this:
SELECT CAST(AVG(CAST(MyTable.MyDateTimeFinish -
MyTable.MyDateTimeStart AS float)) AS datetime)
But how on earth do I find the first and last entry of my unique IP row so I can have a start and finish time? I'M stuck.
Would like to calculate the average time spent per IP. in a single row