Back
In MySQL, I have two different databases -- let's call them A and B.
Is it possible to perform a join between a table that is in database A, to a table that is in database B?
If the account has appropriate permissions, then you can use the below code.
Query:
SELECT <...>FROM A.table1 t1 JOIN B.table2 t2 ON t2.column2 = t1.column1;
SELECT <...>
FROM A.table1 t1 JOIN B.table2 t2 ON t2.column2 = t1.column1;
Note: you've got to prefix the table reference with the name of the DB it resides in.
31k questions
32.8k answers
501 comments
693 users