Created
June 29, 2016 23:06
-
-
Save Fhernd/b9cd6ceb0b5fc0a94bebbc113a4120e5 to your computer and use it in GitHub Desktop.
Combinación de registros a través del operador UNION ALL. [OrtizOL]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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