You would specify the database by using the syntax databasename.tablename
Example:
SELECT
mydatabase1.tblUsers.UserID,
mydatabse2.tblUsers.UserID
FROM
mydatabase1.tblUsers
INNER JOIN mydatabase2.tblUsers
ON mydatabase1.tblUsers.UserID = mydatabase2.tblUsers.UserID
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…