SELECT * FROM HumanResources.Employee e JOIN HumanResources.EmployeeDepartmentHistory ed ON e.BusinessEntityID =ed.BusinessEntityID ORDER BY ed.EndDate
SELECT * FROM HumanResources.Employee e JOIN HumanResources.EmployeeDepartmentHistory ed ON e.BusinessEntityID =ed.BusinessEntityID ORDER BY ed.EndDate