Running a query on multiple databases

2005-05-03 Thread Mahmoud Badreddine
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

Re: Running a query on multiple databases

2005-05-03 Thread SGreen
Mahmoud Badreddine [EMAIL PROTECTED] wrote on 05/03/2005 01:43:55 PM: 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

RE: Running a query on multiple databases

2005-05-03 Thread Jay Blanchard
[snip] 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

Re: Running a query on multiple databases

2005-05-03 Thread Andrés Villanueva
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