Skip to content

Instantly share code, notes, and snippets.

@eklect
Created June 21, 2024 17:18
Show Gist options
  • Save eklect/8f598d2fb7c7225ebaf517507172e3b9 to your computer and use it in GitHub Desktop.
Save eklect/8f598d2fb7c7225ebaf517507172e3b9 to your computer and use it in GitHub Desktop.
Mysql → Remove non-digit characters from string in select statement
#This is for MySQL 8+ and MariaDB 10.0.5+
select REGEXP_REPLACE(COLUMN_NAME_HERE,'\\D','') from TABLE_NAME_HERE;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment