List:General Discussion« Previous MessageNext Message »
From:Andrés Villanueva Date:May 3 2005 5:57pm
Subject:Re: Running a query on multiple databases
View as plain text  
That's exactly what a join does... join two or more tables as one, but 
you usually define a common field to join the tables by...
If both tables have the same definition and you want to know how to 
display the data of one of them after the other you need to do a:

select * from db1.table1 union select * from db2.table2;

Andrés Villanueva


Mahmoud Badreddine wrote:

>Hi,
>I would like to run a query on two tables that reside in two distinct 
>databases:
>
>select * from db1.table1 join db2.table2;
>
>This lists both tables adjacent to one another rather than in a sequential 
>fashion as one would get if both tables came from the same database.
>Is there a way to accomplish this task. 
>
>Thank you.
>
>
>  
>

Thread
Running a query on multiple databasesMahmoud Badreddine3 May
  • Re: Running a query on multiple databasesSGreen3 May
  • Re: Running a query on multiple databasesAndrés Villanueva3 May
RE: Running a query on multiple databasesJay Blanchard3 May