Skip to content

Instantly share code, notes, and snippets.

@fwbrasil
Last active November 7, 2017 02:21
Show Gist options
  • Save fwbrasil/bd3179fbab007a0645f16492bce16749 to your computer and use it in GitHub Desktop.
Save fwbrasil/bd3179fbab007a0645f16492bce16749 to your computer and use it in GitHub Desktop.
SELECT x2.*
FROM
(SELECT LOWER (x2._1) _1,
COUNT(*) _2
FROM
(SELECT explode(SPLIT(x1.text, ' ')) _1
FROM (?) x1) x2
WHERE x2._1 LIKE (concat('#', '%'))
GROUP BY LOWER (x2._1)) x10
ORDER BY - (x2._2) ASC NULLS FIRST
LIMIT ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment