Top "Auto-increment" questions

a database constraint that automatically increases from the last record when making an INSERT

How to reset AUTO_INCREMENT in MySQL?

How can I reset the AUTO_INCREMENT of a field? I want it to start counting from 1 again.

mysql sql auto-increment
How to create id with AUTO_INCREMENT on Oracle?

It appears that there is no concept of AUTO_INCREMENT in Oracle, up until and including version 11g. How can …

sql oracle auto-increment
PostgreSQL Autoincrement

I'm switching from MySQL to PostgreSQL and was wondering how I can do autoincrement values. I saw in the PostgreSQL …

postgresql auto-increment
How to set initial value and auto increment in MySQL?

How do I set the initial value for an "id" column in a MySQL table that start from 1001? I want …

mysql insert auto-increment
How to set auto increment primary key in PostgreSQL?

I have a table in PostgreSQL with many columns, and I want to add an auto increment primary key. I …

sql postgresql auto-increment
Reset AutoIncrement in SQL Server after Delete

I've deleted some records from a table in a SQL Server database. Now the ID's go from 101 to 1200. I want …

sql-server auto-increment delete-row
How to make MySQL table primary key auto increment with some prefix

I have table like this table id Varchar(45) NOT NULL AUTO_INCREMENT PRIMARY KEY, name CHAR(30) NOT NULL, I want …

mysql auto-increment
How do I add a auto_increment primary key in SQL Server database?

I have a table set up that currently has no primary key. All I need to do is add a …

sql sql-server auto-increment
Get current AUTO_INCREMENT value for any table

How do I get the current AUTO_INCREMENT value for a table in MySQL?

mysql auto-increment
Get the new record primary key ID from MySQL insert query?

Let's say I am doing a MySQL INSERT into one of my tables and the table has the column item_…

mysql insert key auto-increment