> hi all -
> i have a table with about 70 rows and 8 cols. i simply want to add a
> colum that will index each row from 0 or 1 to 69 or 70 (doesnt matter
> where the index starts)
> i just dont want to have to create a colum and fill in the rows myself
> with the numbers. can this be done with a simple command in mysql?
> - s
This is untested, but should work:
alter table tablename add new_col int auto_increment primary key;
If it does not, dump the table out, drop and re-create, then reload the
data back it, and all inserts should change the auto_increment field.
|• auto increment||proneone||16 Jun|
| • Re: auto increment||Sasha Pachev||16 Jun|