Creating Auto-Incrementing Columns

Creating Auto-Incrementing Columns

How can I make a column that will automatically increment by one each timea new row is inserted into the table?

The solution will depend upon the database server you are using. Manydatabases have implemented specialized functions that will automaticallyincrement a column, or otherwise automatically create a unique column(usually based on a timestamp or similar). Check your documentation’sindex for COUNTER(), “auto increment”, or similar topics — or scan areference of all the available functions to determine if one will serveyour purpose.


Share the Post: