0 votes
1 view
in SQL by (22.4k points)

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?

1 Answer

0 votes
by (40.3k points)

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;

Note: you've got to prefix the table reference with the name of the DB it resides in.

Related questions

0 votes
1 answer
+3 votes
1 answer
+3 votes
1 answer
asked Jul 3 in SQL by Tech4ever (22.4k points)
+2 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...