Viewing 15 posts - 1,966 through 1,980 (of 4,087 total)
I assumed that you wanted to partition by ID. That can easily be changed if that's not the case.
create table #ObjectStates (
[ID] int,
January 23, 2017 at 3:17 pm
January 23, 2017 at 3:01 pm
January 23, 2017 at 2:45 pm
January 23, 2017 at 2:41 pm
January 23, 2017 at 2:37 pm
Why are you adding columns to a temporary table instead of just including them when you create the table?
Drew
January 23, 2017 at 2:00 pm
FIRST_VALUE requires a ROWS/RANGE clause. Since you haven't supplied one, it is using the default ROWS UNBOUNDED PRECEDING.
FIRST_VALUE returns the first value. Null is not a value, it's...
January 23, 2017 at 1:36 pm
The problem with using the quirky update is that it's, well, quirky. It's not guaranteed to work. Here is a method that uses guaranteed methods and performs only slightly slower...
January 23, 2017 at 12:58 pm
And what do you want to do if you have date ranges that overlap? Are you really still on SQL 2005? SQL 2012 has a feature that makes this much...
January 23, 2017 at 12:15 pm
Viewing 15 posts - 1,966 through 1,980 (of 4,087 total)