Transfer data between tables in MySQL
Transfer data between tables in MySQL
am 29.11.2006 12:44:24 von Rosen Marinov
Hi,
I have to transfer all data between two tables ( with identical structure )
Is this possible with one query, or I must read from table1 and manually
insert into table2?
Thanks in advance,
Rosen
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: Transfer data between tables in MySQL
am 29.11.2006 13:18:44 von Bastien Koert
insert into tableb (select * from tablea)
bastien
>From: "Rosen"
>To: php-db@lists.php.net
>Subject: [PHP-DB] Transfer data between tables in MySQL
>Date: Wed, 29 Nov 2006 13:44:24 +0200
>
>Hi,
>I have to transfer all data between two tables ( with identical structure )
>Is this possible with one query, or I must read from table1 and manually
>insert into table2?
>
>Thanks in advance,
>Rosen
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
____________________________________________________________ _____
Find a local pizza place, music store, museum and more
then map the best
route! Check out Live Local today! http://local.live.com/?mkt=en-ca/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Transfer data between tables in MySQL
am 29.11.2006 13:50:02 von Rosen Marinov
Thanks very much!
Before I try something like "insert into tableb values (select * from
tablea)" and it didn't work, but now I see the word "values" is no needed.
Thank you
""Bastien Koert"" wrote in message
news:BAY135-F36BD21AC8FB8CE754E17AF9DE40@phx.gbl...
> insert into tableb (select * from tablea)
>
> bastien
>
>
>>From: "Rosen"
>>To: php-db@lists.php.net
>>Subject: [PHP-DB] Transfer data between tables in MySQL
>>Date: Wed, 29 Nov 2006 13:44:24 +0200
>>
>>Hi,
>>I have to transfer all data between two tables ( with identical
>>structure )
>>Is this possible with one query, or I must read from table1 and manually
>>insert into table2?
>>
>>Thanks in advance,
>>Rosen
>>
>>--
>>PHP Database Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> ____________________________________________________________ _____
> Find a local pizza place, music store, museum and more
then map the best
> route! Check out Live Local today! http://local.live.com/?mkt=en-ca/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Transfer data between tables in MySQL
am 29.11.2006 13:50:02 von Rosen Marinov
Thanks very much!
Before I try something like "insert into tableb values (select * from
tablea)" and it didn't work, but now I see the word "values" is no needed.
Thank you
""Bastien Koert"" wrote in message
news:BAY135-F36BD21AC8FB8CE754E17AF9DE40@phx.gbl...
> insert into tableb (select * from tablea)
>
> bastien
>
>
>>From: "Rosen"
>>To: php-db@lists.php.net
>>Subject: [PHP-DB] Transfer data between tables in MySQL
>>Date: Wed, 29 Nov 2006 13:44:24 +0200
>>
>>Hi,
>>I have to transfer all data between two tables ( with identical
>>structure )
>>Is this possible with one query, or I must read from table1 and manually
>>insert into table2?
>>
>>Thanks in advance,
>>Rosen
>>
>>--
>>PHP Database Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> ____________________________________________________________ _____
> Find a local pizza place, music store, museum and more
then map the best
> route! Check out Live Local today! http://local.live.com/?mkt=en-ca/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Transfer data between tables in MySQL
am 30.11.2006 02:44:54 von benmoreassynt
Rosen wrote:
> Hi,
> I have to transfer all data between two tables ( with identical structure
> ) Is this possible with one query, or I must read from table1 and manually
> insert into table2?
>
> Thanks in advance,
> Rosen
INSERT INTO `dbase2`.`table1`
SELECT *
FROM `dbase1`.`table1` ;
That will copy from 1st database to second. If you use phpMyAdmin you can do
it via the "operations" tab.
BMA
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php