thanks for the reply.
The db is actually normalized, the relevant structure is as follows
UID (INT) - the actually record identifier, autoincremented and unique
PARENT_ID (INT) - references the id number for another table, this would be the grouping records that belong to the "parent" row in the other table, or foreign key
PROD_VARIANT_ID (INT) - references "the incremented count of records belonging to the parent row in other table,
for example the UID and PARENT_ID are already filled in, but only the prod_variant_id needs to be correctly filled in 1,2,3, next group 1,2,3,4,5,6,, etc - here is what I am trying to accomplish
UID,Parent id, prod_variant_id
123, 100, 1
124, 100, 2
125, 100, 3
126, 101, 1
127, 101, 2
128, 101, 3
129, 101, 4
130, 102, 1
131, 102, 2