MySQL Forums
Forum List  »  General

Re: Rename column but keep old name as alias
Posted by: Rick James
Date: December 23, 2015 09:48PM

ALTER TABLE foo ADD COLUMN UserSpareField1 ... (same definition as poNumber );
UPDATE TABLE foo SET UserSpareField1 = poNumber;
Now you have two columns with (temporarily) the same data.
Later you can use DROP COLUMN to get rid of one of them.

If this does not answer your question, then I need more info on what you are trying to do.

Options: ReplyQuote


Subject
Written By
Posted
Re: Rename column but keep old name as alias
December 23, 2015 09:48PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.