Top "Auto-increment" questions

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

Add Auto-Increment ID to existing table?

I have a pre-existing table, containing 'fname', 'lname', 'email', 'password' and 'ip'. But now I want an auto-increment column. However, …

mysql sql definition auto-increment
Hibernate Auto Increment ID

I have a j2ee application using hibernate with annotation. How do I annotate the Id field in my pojo …

java hibernate auto-increment
How to generate auto increment field in select query

For example I have a table with 2 columns, first_name and last_name with these values Ali Khani Elizabette Amini …

sql-server auto-increment
Reset auto increment counter in postgres

I would like to force the auto increment field of a table to some value, I tried with this: ALTER …

sql postgresql reset auto-increment
PHP mySQL - Insert new record into table with auto-increment on primary key

Wondering if there is a shorthand version to insert a new record into a table that has the primary key …

php mysql insert auto-increment
How to add an auto-incrementing primary key to an existing table, in PostgreSQL?

I have a table with existing data. Is there a way to add a primary key without deleting and re-creating …

postgresql primary-key auto-increment
make an ID in a mysql table auto_increment (after the fact)

I acquired a database from another developer. He didn't use auto_incrementers on any tables. They all have primary key …

mysql primary-key auto-increment
Auto Increment after delete in MySQL

I have a MySQL table with a primary key field that has AUTO_INCREMENT on. After reading other posts on …

sql mysql primary-key auto-increment
ERROR: permission denied for sequence cities_id_seq using Postgres

I'm new at postgres (and at database info systems all in all). I ran following sql script on my database: …

sql postgresql permissions auto-increment
MySQL: #1075 - Incorrect table definition; autoincrement vs another key?

Here is a table in MySQL 5.3.X+ db: CREATE TABLE members` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `memberid` VARCHAR( 30 ) …

mysql primary-key auto-increment mysql-error-1075