I have an Oracle table with rows organized in groups, each group with an unique attribute name, WELL_NAME, and sorted by an attribute, DEPTH. I want to add an attribute called SURVEY_NO that auto generates a sequential number for each row within each group, starting with 1, then 2, .. and end with the last row in that sorted group. So it will look like:
WELL_NAME DEPTH SURVEY_NO
name1 10 1
name1 20 2
name1 30 3
name2 10 1
name2 20 2
name3 30 3