Skip to content

Instantly share code, notes, and snippets.

@timotewb
Created April 21, 2020 19:40
Show Gist options
  • Save timotewb/2e8ea043e0965f5b2d601fe8de1292d4 to your computer and use it in GitHub Desktop.
Save timotewb/2e8ea043e0965f5b2d601fe8de1292d4 to your computer and use it in GitHub Desktop.
select
'testing1234521 with chars x2' as original_string,
trim(
translate(
original_string,
translate(
original_string,
'1234567890',
''
),
''
)
)::bigint as only_numbers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment