Creating Unique Values
Posted in 1994
Help me please, I am trying to figure out the easiest way to create unique values in a field. I know about the serial data type, but it doesn't quite do what I want. What I need to do is create unique values for records based on another field i.e. if I have two fields in the database as follows: Map_Number Num Unique_number Num and for each unique Map_Number there are n rows/records, I want to fill Unique_number with values ranging from 1 to n. For the next unique Map_Number I want to be able to repeat this, filling Unique_number with values from 1 to n and so on. Is there a simple way to this, if so please let me know, Thanks for any help, Alastair J. Small Tel: +353-1-676-0666 duQuesne Limited Fax: +353-1-676-8417 4 Merrion Square Email: asmall2@duquesne.ie Dublin, Ireland