# Joining Between Databases in Hive

Via Stephen Sprauge we have a solution to a true headbanger; joining two tables in two different databases in Hive. Hive objects to (1) the use of AS in JOINs to declare aliases, and (2) the use of the database.table.column format; the trick is to have database.table as a silent alias, and then alias.column, like so:

SELECT
alias1.column1,
alias1.column2,
alias2.column1
FROM
database1.table1 alias1
INNER JOIN
database2.table2 alias2
ON
alias1.column1 = alias2.column1;


At which point Hive begins behaving.