Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created June 29, 2016 23:06
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/b9cd6ceb0b5fc0a94bebbc113a4120e5 to your computer and use it in GitHub Desktop.
Save Fhernd/b9cd6ceb0b5fc0a94bebbc113a4120e5 to your computer and use it in GitHub Desktop.
Combinación de registros a través del operador UNION ALL. [OrtizOL]
SELECT BusinessEntityID,
GETDATE() QuotaDate,
SalesQuota
FROM Sales.SalesPerson
WHERE salesQuota > 0
UNION ALL
SELECT BusinessEntityID,
QuotaDate,
SalesQuota
FROM Sales.SalesPersonQuotaHistory
WHERE SalesQuota > 0
ORDER BY BusinessEntityID DESC,
SalesQuota DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment