What is the fastest and easiest way to do this?
Copy all the "id" column value into "sequence" column inside a table?
Starting from record one to the last record?
I tried creating the "sequence" column and assigned the auto increment but it won't allow me.
So I have no choice but to copy the value from "id" column and put the value in "sequence" column.
Thanks in advance.
Okay I figured it out.
UPDATE lessons SET sequence = lessonid;
Thanks to Google.
I am not sure exactly. But there should be a way to disable the auto increment on column. Then do a update and then enable the auto increment such that it should start from the max(id)+1
Why do you want to duplicate information in the database? What will happen when sequence gets changed to a different value to the corresponding id?
because i told him not to renumber the PK values, but to use a sequence column instead -- http://www.sitepoint.com/forums/showthread.php?1179774-How-to-rename-indexes
copying the id values to the sequence column is the necessary first step in that process
This topic is now closed. New replies are no longer allowed.