阅读背景:

当列值更改时,如何将组编号添加到SQL Server 2012中的顺序记录?

来源:互联网 

I've been playing with window functions in SQL Server 2012 and can't get this to work, as I'm hoping to avoid a cursor and going row by row. My problem is that I need to add a group number to each record. The tricky part is that the group number has to increment each time a column value changes, even if it changes back to a value that existed before earlier in the sequence of records.I've been playing with window functions in SQL




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: