Skip to content

Instantly share code, notes, and snippets.

@nkezhaya
Created May 16, 2021 17:29
Show Gist options
  • Select an option

  • Save nkezhaya/05b88c004e63d8a8e72e30939a5878dd to your computer and use it in GitHub Desktop.

Select an option

Save nkezhaya/05b88c004e63d8a8e72e30939a5878dd to your computer and use it in GitHub Desktop.
WITH RECURSIVE t AS (
SELECT min(author) AS author FROM posts
UNION ALL
SELECT (SELECT min(author) FROM posts WHERE author > t.author)
FROM t WHERE t.author IS NOT NULL
)
SELECT author FROM t WHERE author IS NOT NULL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment