Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to update a column in existing records with serial numbers?

Status
Not open for further replies.

briandunning

Technical User
Dec 23, 2004
2
US
I have 117,000 records in a table, and unfortunately I'm deciding "after the fact" to add a n auto_increment id column. How do I update the existing records with serial numbers?
 
The last time I found myself in that situation, I sent the data to a file using SELECT...INTO <outfile> query, deleted all data from the table, added the auto_increment column, then reimported the data using a LOAD DATA...INFILE query.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top