Created
March 15, 2012 11:11
-
-
Save i-e-b/2043696 to your computer and use it in GitHub Desktop.
TSQL count and value for grouped GUIDs
This file contains hidden or 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 | |
CAST(MIN(CAST(myGuid AS BINARY(16))) AS UNIQUEIDENTIFIER) AS [TheGuid], | |
COUNT(myGuid) AS [ItsCount] | |
FROM MyTable | |
GROUP BY myGuid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment