Skip to content

Instantly share code, notes, and snippets.

@akoidan
Created June 11, 2019 14:04
Show Gist options
  • Save akoidan/25a0b87784cb49a1365c6751d43a4305 to your computer and use it in GitHub Desktop.
Save akoidan/25a0b87784cb49a1365c6751d43a4305 to your computer and use it in GitHub Desktop.
SELECT
"comment"."id",
...
FROM "comment"
WHERE ("comment"."id" IN (SELECT U0."id"
FROM "comment" U0
WHERE U0."user_id" = ("comment"."user_id")
ORDER BY U0."created_at" DESC
LIMIT 5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment