Say I have 2 columns
Product Product_Cat
------- -----------
Cat 0
Dog 0
Potatoes 2
Carrots 2
Laundry 1
Bird 0
I want to add on a 3rd identity column but I want the numbering to be unique per Product_Cat So the output would look like
Product Product_Cat Cat_Ident
------- ----------- ---------
Cat 0 1
Dog 0 2
Potatoes 2 1
Carrots 2 2
Laundry 1 1
Bird 0 3
How do you do this?
This of course is not my real data but a simplification of what I want to do. in my live system I have 4585 different values of "Product_Cat" and they range from 1 to 2408 "Products" in the category.