Re: howto merge tables..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
3F45E111.6050906@uncertainty.org.uk">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
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux