Skip to content

Instantly share code, notes, and snippets.

@myui
Created June 16, 2017 08:46
Show Gist options
  • Save myui/cfd8f9140392bfe56c4c89285696150b to your computer and use it in GitHub Desktop.
Save myui/cfd8f9140392bfe56c4c89285696150b to your computer and use it in GitHub Desktop.
limit url to level 2 depth
select
  recent1[3] as url,
  regexp_extract(
    recent1[3],
    '^https?://[^/]+(/[^/]+){0,2}'
  ) as extracted
from
  pre_hivemall_ac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment