This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Oracle/OAS and the fly likes Updating duplicate rows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Updating duplicate rows" Watch "Updating duplicate rows" New topic

Updating duplicate rows

juniad Ahmed

Joined: Feb 19, 2011
Posts: 24
Hi Guys i am facing a problem updating all but one duplicate rows. If i have 0 duplicate record in my table i should update 9 records and leave the other record as it is. For example

if i have the following records

Id Fname Lname
1 abc xyz
2 abc xyz
3 abc xyz
4 abc xyz
5 abc xyz
6 abc xyz
7 abc xyz
8 abc xyz
9 abc xyz
10 abc xyz

after i run the query the result should be some thing like this

Id Fname Lname
1 abc xyz
2 abc xyz_1
3 abc xyz_2
4 abc xyz_3
5 abc xyz_4
6 abc xyz_5
7 abc xyz_6
8 abc xyz_7
9 abc xyz_8
10 abc xyz_9

juniad Ahmed

Joined: Feb 19, 2011
Posts: 24
Its 10 record not 0
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Updating duplicate rows
It's not a secret anymore!