Home > Archive > SQL Anywhere database > October 2005 > Join in a Query two tables that are in differente databases









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Join in a Query two tables that are in differente databases
Manuel Rodriguez

2005-10-27, 7:40 am

How can I join to tables with a commun field that
are located in different databases?


Andrew Giulinn

2005-10-27, 7:40 am

Hey Manuel

I think you will need to look at CREATE SERVER (to tell one database [the
"local" database] where/how to find the other database [the "remote"
database) and CREATE EXISTING TABLE (to "create" the table in the remote
database in the local database).

Then you can just do a standard select/join, ie

SELECT * FROM
LOCAL_TABLE L JOIN REMOTE_TABLE R ON (L.COMMON_FIELD = R.COMMON_FIELD);

Cheers

--
Andrew Giulinn
Senior Analyst/Programmer
Integrated Aviation Software Pty Ltd

"Manuel Rodriguez" < ManuelRodriguez24@ya
hoo.com> wrote in message
news:43581a2e@forums
-2-dub...
> How can I join to tables with a commun field that
> are located in different databases?
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com