Skip to content

Instantly share code, notes, and snippets.

@sgoggins
Created April 17, 2024 20:54
Show Gist options
  • Save sgoggins/41f67203e072287a93d3f669f3d018dd to your computer and use it in GitHub Desktop.
Save sgoggins/41f67203e072287a93d3f669f3d018dd to your computer and use it in GitHub Desktop.

SQL to extract the GitHub organization from a repository URL

SELECT distinct 
    substring(repo_git from 'github.com/([^/]+)/') as org_name
FROM
    repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment