Re: howto merge tables..
| From: | FB | Date: | Fri, 22 Aug 2003 09:28:49 +0000 |
| Subject: | Re: howto merge tables.. | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-30042@lists.php.net to get a copy of this message | ||
that was preety good..
merged 3 tables with 2 million raws in 3 minutes...
thanks
FB
"Sean Burlington" <sean@uncertainty.org.uk> wrote in message
news:3F45E111.6050906@uncertainty.org.uk...
> FB wrote:
> > Hi,
> >
> > I have 3 similar tables. I want to merge them. The thing I use is
> >
> > 1) SELECT *
> > 2) Make a while statement
> > 3) INSERT each raw into the other table
> >
> > is there a easier way?
> >
> > FB
>
> if the columsn are identical
>
> insert into table1 select * from table2;
> insert into table1 select * from table3;
>
> if the column names are different
>
> insert into table12 (colname1, calname2) select colname3, colname4 from
> walks;
>
> the above works on mysql ...
>
> --
>
> Sean
>