carlosp Posted April 9, 2013 Share Posted April 9, 2013 (edited) i need to create a script which update the mysql records i have this table ID CODE 1000 abcd 1001 abcd 1002 abcd 1003 abcd 1004 abcd ....... 1049 abcd 1050 qwer 1051 qwer 1052 qwer 1053 qwer ....... 1098 qwer 1099 qwer 1100 38xs ...... 17037 djaso 17038 djaso i need to update only the IDs. There are like 25.000 rows in this table, the IDs are not all sequential (1,2,3,6...49,80,81...129,283,284...24800,24801...24810,25000) then the ID's will start from last ID+1 (25001) each CODE is present in this table 50 times and the IDs corresponding to each code are sequential How can i do that? Thank you! Edited April 9, 2013 by carlosp Quote Link to comment Share on other sites More sharing options...
Barand Posted April 9, 2013 Share Posted April 9, 2013 IDs are unique identifiers for rows within a table and their sequence should be of no relevance to your application. The application should work the same way even if these unique ids were generated randomly rather sequentially. Sometimes I wish they were so people wouldn't have hangups about gaps in id sequences. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.