If both databases are on the same server, you just need to use a 3 part naming convention for your tables in the query.
SELECT one.A, one.B, one.C, two.A, two.B, two.C
FROM DatabaseName1.dbo.tableName AS one
INNER JOIN DatabaseName2.dbo.tableName AS two
ON one.A = two.A
If they are different servers you will need to create a linked server on one of the servers and use a 4 part naming convention for the remote db.
SELECT one.A, one.B, one.C, two.A, two.B, two.C
FROM dbo.tableName AS one
INNER JOIN LinkedServerName.DatabaseName2.dbo.tableName AS two
ON one.A = two.A