INSERT SELECT with multiple databases

This is a discussion on INSERT SELECT with multiple databases within the MySQL Database forums, part of the Database Forums category; Hello, I want to do an insert select, where data from one table in one database is copied into another ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-07-2007
Nick Mudge
 
Posts: n/a
Default INSERT SELECT with multiple databases

Hello,

I want to do an insert select, where data from one table in one
database is copied into another table in another database. The
databases are on the same server. The tables have the same structure.

I have tried: INSERT INTO db1.table SELECT * FROM db2.table
but I keep getting this error: Incorrect table name

Is it possible to do an INSERT SELECT with different databases on the
same server?

Reply With Quote
  #2 (permalink)  
Old 06-07-2007
Dikkie Dik
 
Posts: n/a
Default Re: INSERT SELECT with multiple databases

> I have tried: INSERT INTO db1.table SELECT * FROM db2.table
> but I keep getting this error: Incorrect table name
>
> Is it possible to do an INSERT SELECT with different databases on the
> same server?
>


I tried the same, but without "db1.", so from the database "db1":

use db1;
INSERT INTO table SELECT * FROM db2.table;

No problems whatsoever.

Best regards.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:33 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0