I'm trying to figure out the best/easiest way to number duplicate rows accordingly.I have a set of data that I am uploading to the database table. I have uploaded it, and auto incremented it, now I want to generate the order_id in the fashion shown in my question. For example
----ID-------NAME-----------ORDER_ID----------
1 Bob Smith 1
2 Steve Jones 2
3 Bob Smith 1
4 Billy Guy 3
5 Steve Jones 2
----------------------------------------------
I was thinking I could use a statement such as select NAME from table where name= duplicate_name
but I can't seem to figure out how I would realistically go about that, much less then enter the appropriate ORDER_ID
afterwards. Is there an easy way to do this ?