-----Ursprüngliche Nachricht-----
Von: c.smart <[EMAIL PROTECTED]>
An: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Datum: 18 March, 2001 01:11
Betreff: Re: join from two different databases


>Sorry, No Green Beer, No can do that ;-)
>
>Richard Reina wrote:
>
>> I am try to do a join with tables that are in two different databases.
>>
>> I thing I've got the actual SQL syntax down:
>>
>> my $q = "SELECT i.inv_no, i.inv_date,
>>         c.cust_name
>>         FROM receivables.invoice i, sales.customer c,
>>         WHERE i.paid_date IS NULL";
>>
>> but I am confused on how to prepare and execute it, since my database
>> handle ($dbh) specifies only 1 database.
>>
>> Any help would get me out of the office on St. Pats day and in fron tof
>> a bar maid serving green beer.  Please help make my day.
>>

I've done this so far in perl, but with no execution plan. Basically it
joins only two tables from different hosts, according to a key you must
explicitly specify. Also I programmed a complete "order by" and limit (which
wasn't very difficult). I cannot release this peace of sh..., but it works
for my environment :-)
Probably such functionality will be built in mysql in the future. At least
Informix and Oracle support "remote-joins" I think...

something like this:
select * from user:pass@host:db.table1, table2, user:pass@host:db-table3
where ...

--Andy



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to