Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Update repeated data

Author  Topic 

jung1975
Aged Yak Warrior

503 Posts

Posted - 2006-10-30 : 21:50:27
I have data looks like below

ID date HGB EPo
9000058 02-SEP-06 35.1 1500
9000058 05-SEP-06 1500
9000058 07-SEP-06 1500
9000058 09-SEP-06 1500
9000058 12-SEP-06 39.3 1500
9000058 14-SEP-06 39.3 1500
9000058 16-SEP-06 39.3 1000
9000058 19-SEP-06 39.3 1000
9000058 21-SEP-06 39.3 1000
9000058 23-SEP-06 39.3 1000
9000058 26-SEP-06 39.3 1000
9000058 28-SEP-06 39.3 1000
9000058 30-SEP-06 39.3 1000

I would like to update the repeated HGB ( row after row) to null in the same ID. In this case, 39.3

The outpit should look like:

ID date HGB EPo
9000058 02-SEP-06 35.1 1500
9000058 05-SEP-06 1500
9000058 07-SEP-06 1500
9000058 09-SEP-06 1500
9000058 12-SEP-06 39.3 1500
9000058 14-SEP-06 1500
9000058 16-SEP-06 1000
9000058 19-SEP-06 1000
9000058 21-SEP-06 1000
9000058 23-SEP-06 1000
9000058 26-SEP-06 1000

How can I do this using update statment?


khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-10-30 : 22:29:12
"I would like to update the repeated HGB ( row after row) to null in the same ID"
You want to update the records in the table or only for presentation ?



KH

Go to Top of Page
   

- Advertisement -