MySQL Forums
Forum List  »  Newbie

Re: Copy entire table
Posted by: Peter Brawley
Date: January 04, 2022 09:29PM

If the id of the new table is auto_increment, or if it accepts nulls, provide a list of its columns without the that auto_inc column ie

insert into newtbl(cola,colb,colc,...) select * from origtbl;

Otherwise you'll need to include it in the list and populate it with values.

Options: ReplyQuote




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.