Skip to content

Instantly share code, notes, and snippets.

@ip75
Last active March 27, 2023 23:46
Show Gist options
  • Save ip75/0feb6efdc2f677da3a6d21ca4c187f9f to your computer and use it in GitHub Desktop.
Save ip75/0feb6efdc2f677da3a6d21ca4c187f9f to your computer and use it in GitHub Desktop.
SELECT (regexp_match(m.file_url, '^.+/(.+)$'))[1] FROM media m WHERE m.file_url LIKE 'http%';
UPDATE media
SET file_url = (regexp_match(file_url, '^.+/(.+)$'))[1]
WHERE file_url LIKE 'http%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment