Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2003
    Location
    Singapore
    Posts
    200

    Unanswered: Add a field to the table

    Hi all,

    I would link to add a fields to a table.The table just has one field and i would like to add a new field called id (integer and auto incremental).the table now has 35000 records.
    How can i do this.I tried by creating a new table with 2 fields,one auto incremental.Now i exported the data from the first table to an OUT FILE.
    Using Load data i tried to import the data.By not working .

    How else can i do this.

    thans
    micky

  2. #2
    Join Date
    Jan 2003
    Location
    Paris, France
    Posts
    320

    Re: Add a field to the table

    Originally posted by mickykt
    Hi all,

    I would link to add a fields to a table.The table just has one field and i would like to add a new field called id (integer and auto incremental).the table now has 35000 records.
    How can i do this.I tried by creating a new table with 2 fields,one auto incremental.Now i exported the data from the first table to an OUT FILE.
    Using Load data i tried to import the data.By not working .

    How else can i do this.

    thans
    micky
    You can use alter table statement

    alter <tablename> add <fieldname> int(11) not null auto_increment primary key
    Olivier Miossec
    --
    http://www.lasso-developpeur.net/
    --

  3. #3
    Join Date
    Mar 2003
    Location
    Singapore
    Posts
    200
    Hi,

    Thank u very much it worked fine.

    mickykt

Posting Permissions

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