Article | October 17th, 2008

How to copy the contents of one table to another using SQL is not immediately obvious.

Create and Populate Table

create table mytablecopy select * from originaltable

Copying a Table into an Existing Table

insert into originaltable select * from mytablecopy


MySQL doesn’t yet support sub-selects. For example you cannot do this:

    select * from things where thing.userid not   in (select userid from

There are no comments yet, add one below.

Leave a Comment

You must be logged in to post a comment.