In my table I have a column Segment_No
which has duplicates. Now I want to update those duplicates.
For example: the value 249X5601 is present in two rows. I want to change the second value to 249X5601R
In my table I have a column Segment_No
which has duplicates. Now I want to update those duplicates.
For example: the value 249X5601 is present in two rows. I want to change the second value to 249X5601R
The general form would be as follows:
Where
<Suitable_Column>
gives the column(s) the define which row is "first" and which is second.<New_Value>
defines how the newSegment_no
value should be computed, andrn
gives the row numbers - so the where clause is ignoring the "first" row.So if there are only ever a max of two rows sharing a single
Segment_no
value, and the "first" is the one with the lowestDonation_ID
value, then it would be: