Viewing 3 posts - 1 through 3 (of 3 total)
Sorry for the delayed response. Got caught up a little bit at my work place. Here is a new approach to the problem. i have tested it with different scenarios...
December 11, 2009 at 10:05 am
Just with a very small change i was able to produce the result you wanted
select * from
(
select *,
row_number() over(partition by record_id, date_changed, new_state order by id) as...
December 2, 2009 at 9:37 am
I have used your #table
select * into #table1 from
(select record_id, date_changed, min(id) min_id, max(id) max_id, new_state
from #table B
group by record_id, date_changed, new_state) a
select * from
(
select *,
row_number()...
December 1, 2009 at 9:06 am
Viewing 3 posts - 1 through 3 (of 3 total)