First page Back Continue Last page Image

Joining Across Different Databases - Analysis

SELECT

stplanets.planetName AS ‘Star Trek Planets’,

planets.planetName AS ‘NASA Planets’

FROM StarPeople.stplanets JOIN dataExamples.planets

ON stplanets.planetName = planets.planetName;

Because the field name was the same in both tables I had to specify the table name

I slipped this one in, If I only use ‘JOIN’ with nothing else it defaults to an INNER JOIN

Cross Database JOIN accomplished with databaseName.TableName designation