Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created July 11, 2016 19:29
Show Gist options
  • Save Fhernd/185b1eb35b8903df338bd016538c0b5e to your computer and use it in GitHub Desktop.
Save Fhernd/185b1eb35b8903df338bd016538c0b5e to your computer and use it in GitHub Desktop.
Uso de DISTINCT para obtener valores únicos de un historial de pagos a empleados. [OrtizOL]
SELECT RateChangeDate,
COUNT(Rate) AS 'Contador',
COUNT(DISTINCT Rate) AS 'Valores Distintos'
FROM HumanResources.EmployeePayHistory
WHERE RateChangeDate >= '2003-01-01T00:00:00.000'
AND RateChangeDate < '2003-01-10T00:00:00.000'
GROUP BY RateChangeDate;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment