I have two fields:
last_modified : datetime
updated_at : timestamp
updated_at is a new field which has just been added to the table, last_modified contains accurate dates.
I want to be able to loop through all of the rows in the table, selecting the last_modifed datetime, converting it into a timestamp and saving it in the new updated_at field.
Have no idea how to do this, any help is much appreciated!
Try
I don’t why you want to store same data twice. Storing same data twice may result into inconsistency.
If you want
timestampin your code, you can do that in code itself.