Last active
July 18, 2019 23:32
-
-
Save ngbrown/b8604e10090c7b1ed5ab34d4eb1b03f9 to your computer and use it in GitHub Desktop.
Check used characters
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
-- Based on https://stackoverflow.com/a/2926213/25182 | |
WITH a AS (SELECT LTRIM(dut_eosonum) AS s, '' AS x, 0 AS n | |
FROM dbo.[dutmast] | |
WHERE LEN(dut_eosonum)>0 | |
UNION ALL | |
SELECT a.s, SUBSTRING(a.s, n+1, 1) AS x, n+1 AS n FROM a WHERE n<LEN(a.s)) | |
SELECT x, COUNT(*) AS c FROM a WHERE n>0 GROUP BY x ORDER BY x | |
OPTION(MAXRECURSION 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment