Skip to content

Instantly share code, notes, and snippets.

@tecnom1k3
Created February 24, 2018 00:50
Show Gist options
  • Save tecnom1k3/bc643d88b5bf9a5cf77effc3cc39fce2 to your computer and use it in GitHub Desktop.
Save tecnom1k3/bc643d88b5bf9a5cf77effc3cc39fce2 to your computer and use it in GitHub Desktop.
get list of characters used in a database column (postgres)
select string_agg(c,'' order by c)
from (
select distinct regexp_split_to_table(lower(field),'') as c
from table1
) t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment