Last active
August 29, 2015 13:57
-
-
Save noborus/9458181 to your computer and use it in GitHub Desktop.
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 COUNT (char) AS frequency, char | |
FROM | |
(SELECT substr (column_name, generate_series (1, LENGTH (column_name)), 1) AS char | |
FROM table_name) AS d | |
GROUP BY char | |
ORDER BY frequency DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SELECT COUNT (char) AS frequency , char
FROM
(SELECT regexp_split_to_table(column_name, '') AS char
FROM table_name) AS w
GROUP BY char
ORDER BY frequency DESC;
こっちのほうが短い