Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created June 30, 2016 17:32
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 Fhernd/da700742e0fc6c2e0c9927d26fe4db86 to your computer and use it in GitHub Desktop.
Save Fhernd/da700742e0fc6c2e0c9927d26fe4db86 to your computer and use it in GitHub Desktop.
Reporte de apellidos de empleados y vendedores. [OrtizOL]
SELECT P1.LastName AS 'Apellido'
FROM HumanResources.Employee AS E
INNER JOIN Person.Person AS P1
ON e.BusinessEntityID = P1.BusinessEntityID
UNION
SELECT P2.LastName AS 'Apellido'
FROM Sales.SalesPerson AS SP
INNER JOIN Person.Person AS P2
ON SP.BusinessEntityID = P2.BusinessEntityID;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment