MySQL Forums
Forum List  »  Newbie

Re: SELECT from different databases/servers tables
Posted by: pearsojd
Date: August 22, 2004 04:59AM

Hi Peter,

If your db is db_1 and the other db on the same engine is db_2;

select table1.attribute1, table2.attribute2
from db_1.table1, db_2.table2
where table1.attribute1 = table2.attribute2;

Obviously you may need to `fully qualify` the statement if you have same table names in both dbs. eg select db1.table1.attribute1, db2.table1.attribute1, etc

That should work assuming you have the appropriate permissons on both db's.

Hope that helps.

James

Options: ReplyQuote


Subject
Written By
Posted
Re: SELECT from different databases/servers tables
August 22, 2004 04:59AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.