Looking at this post and your previous one, you could just create a new
table with the same definition as the old table except to make the field you
want with the numbered field be an "int auto_increment" datatype.
Then do the following SQL:
Insert Into newtable
Select field1, field2, NULL, field3, field4...
>From oldtable;
You have to list all the fields in the old table EXCEPT the one you want
auto incremented in a sequence. In that field's position you put NULL (or
zero), and MySQL will increment the field for you as it does the inserts.
..chris
----- Original Message -----
From: "Jaime Teng" <[EMAIL PROTECTED]>
Hi,
Is there a "number sequence" generator/function in
MySQL such that if I were to execute:
"UPDATE mytable SET id = thisfunction;"
it will update the table mytable and set the column
id to a numbered sequence "1,2,3,4,5,6,7,8,9....."?
currently, i have a table with 2.5 million records and
i want to change one of the field and sequence it and
am doing it the hard way of updating one at a time.
regards
Jaime
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php