Skip to content

Instantly share code, notes, and snippets.

@helix84
Created September 8, 2015 12:32
Show Gist options
  • Save helix84/c829a7f7fd4607579e6f to your computer and use it in GitHub Desktop.
Save helix84/c829a7f7fd4607579e6f to your computer and use it in GitHub Desktop.
-- preview change
SELECT *, regexp_replace(handle, '123456789/(.*)', E'123/\\1') FROM handle
WHERE handle LIKE '123456789/%'
LIMIT 50;
-- change 123456789/ to 123/
UPDATE handle SET handle = regexp_replace(handle, '123456789/(.*)', E'123/\\1') WHERE handle LIKE '123456789/%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment