I have to fix a table where date and time are stored as unix timestamps. I want to convert the current format into the mysql datetime type while preserving the original columns for the moment. (working on a running system, a bit like open heart surgery).
I have made a copy of the current table and want to a FROM_UNIXTIMESTAMP to inser the values into the original table into the matching rows. I might be on the right track with my statement but I can’t get it to work.
INSERT INTO signup (add_time) SELECT FROM_UNIXTIME(addtime) FROM signup_backup WHERE signup.UID = signup_backup.UID;
This is my current approach but I get unknown column and I know why but I can’t figure out how to fix the syntax of the statement.
Why do you use INSERT? I guess you should use UPDATE: