Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created June 14, 2019 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/989a17ea8b58c0bf3942ed3b44f24417 to your computer and use it in GitHub Desktop.
Save parzibyte/989a17ea8b58c0bf3942ed3b44f24417 to your computer and use it in GitHub Desktop.
select e.BusinessEntityID, e.*,
d.Name
from HumanResources.Employee e
inner join
HumanResources.EmployeeDepartmentHistory h
on e.BusinessEntityID = h.BusinessEntityID
inner join HumanResources.Department d
on d.DepartmentID = h.DepartmentID
and h.EndDate is null
and d.Name in ('Quality Assurance', 'Production');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment