Skip to content

Instantly share code, notes, and snippets.

@hoosteeno
Last active August 29, 2015 14:14
Show Gist options
  • Save hoosteeno/9d392f330a8026bb6ed9 to your computer and use it in GitHub Desktop.
Save hoosteeno/9d392f330a8026bb6ed9 to your computer and use it in GitHub Desktop.
get the website from the user profile in MDN
select substring(
misc
from (
/* start substring after but not including website key */
locate('"website": ', misc) + 12
)
for (
/* the location of the first " after the website key... */
locate('"', misc, locate('"website": ', misc) + 12)
/* minus the location of the website key plus the length of the website key */
- (locate('"website": ', misc) + 12)
)
)
as url from user_profiles
where misc is not null
and misc REGEXP'"website": ';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment