Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Location
    CA
    Posts
    38

    Unanswered: auot-generation of a column value

    Hi,
    How do I create a column which has an auto-generated number i.e. unique serialized number that increments by 1 on every insertion of a row?
    Thanx.
    Pooja

  2. #2
    Join Date
    Oct 2003
    Posts
    16
    An example:

    create table Student(id int auto_increment primary key, name varchar(30)) type=innodb;

    mysql> insert into Student values(NULL, "Prasanna");

    Inserting a NULL value will increment the value of id everytime.

    Prasanna

  3. #3
    Join Date
    Sep 2003
    Location
    CA
    Posts
    38
    hey thanx a lot for that...looks really cool....goin' to try it now!
    pooja

    Originally posted by padm2016
    An example:

    create table Student(id int auto_increment primary key, name varchar(30)) type=innodb;

    mysql> insert into Student values(NULL, "Prasanna");

    Inserting a NULL value will increment the value of id everytime.

    Prasanna

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •