How can i populate a field with the order in which it was retrieved by a query.

example...
i have a record with 2 fields name and index and i use the query select name from tblCustomers order by name
when for example i have 3 names in it
Andre, Peter and Caroline i want their index fields to contain 1,3,2. When there are duplicate names...
In case of duplicate names :
Andre, Andre, Peter and Caroline the result should be 1,1,3,2