Tuesday, February 10, 2009

Autoincrement in MySQL

Most of the ppl use to search in net for to add auto increment field in MySQL.
Its actually very easy like other databases. We have to add the property while creating the table it self like below.
CREATE TABLE emp (
id INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, fname VARCHAR(255)
)