Home Delete unchanged value group by id and time
Reply: 0

Delete unchanged value group by id and time

LilyXO
1#
LilyXO Published in 2018-01-12 17:06:00Z

I am using SQL Server 2008 R2 and I have a table with the columns:

cid (int)

ctime (datetime)

cvalue (real)

The table contains more than one billion rows.

I need to delete unchanged data between changed values and keep changed, previous and next rows (when sorted by ctime) with the values for any cid. So for example, in the results below, I would want to delete the records highlighted in red boxes:

How should I go about doing this?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.331845 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO