【SQL开源代码栏目提醒】:本文主要为网学会员提供ScriptSample.sql,希望对需要ScriptSample.sql网友有所帮助,学习一下!
USE AdventureWorks
GO
SELECT c.FirstName + ' ' + c.LastName AS 'Employee Name',
a.AddressLine1, a.AddressLine2 , a.City, a.PostalCode
FROM Person.Contact AS c
INNER JOIN HumanResources.Employee AS e
ON c.ContactID = e.ContactID
INNER JOIN HumanResources.EmployeeAddress ea ON
ea.EmployeeID = e.EmployeeID
INNER JOIN Person.Address AS a ON a.AddressID = ea.AddressID
GO