Try this...
SELECT * FROM [DataBaseName].[Schema].[Table] WHERE [Your Condition]
You can also use such queries in Join's e.g You have two DataBases
DataBase1:
DataBase Name : MyDB1
Table Name : Table1
DataBase2:
DataBase Name : MyDB2
Table Name : Table1
Note: Both tables have same structure like (Id, Name, FatherName, Address)
Your query will be ..
SELECT *
FROM MyDB1.dbo.Table1 a
INNER JOIN MyDB2.dbo.Table1 b
ON a.Id = b.Id