Number range for custom DB table field
I want a number to be generated in a field of a custom DB table every time I insert an entry in this table. This number should be in a range. But I don't know how to assign a range to a custom table field and what to write in the program so that every time, the next number in the range, to be generated for this field.
Can anybody help me?
Thank you in advance,