Skip to content

Instantly share code, notes, and snippets.

@DownRangeDevOps
Last active August 29, 2015 14:13
Show Gist options
  • Save DownRangeDevOps/68278a793e4b81630334 to your computer and use it in GitHub Desktop.
Save DownRangeDevOps/68278a793e4b81630334 to your computer and use it in GitHub Desktop.
-- Input
-- www.example.com
-- example.com
-- .example.com
UPDATE domains
SET name = trim(REPLACE(concat(" ",name," "),'www.',''))
-- Output
-- example.com
-- example.com
-- .example.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment