December 1, 2014 at 6:24 am
Hi guys,
We got a table in a form like this:
Imagine it has millions of records! I'm looking for a simple query which fills the '?' mark for 'diffValue' column!
'diffValue' represents the difference between the value of 'sesSentOctets' of the current row and the previous row (previous minute for the same 'userName'). For instance for the last record, it must result in 140 (1688 - 1548).
Because we have millions of records, I want a very fast query for that! I know it is solvable by functions or other inner SELECT commands, but they are slow! I want it to be done with just one SELECT if it is possible!
Many thanks in advance.
December 1, 2014 at 6:58 am
Duplicate post. All answers in here: http://www.sqlservercentral.com/Forums/Topic1640241-392-1.aspx
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply