Skip to content

Instantly share code, notes, and snippets.

@ketanbhatt
Created May 14, 2017 09:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Avoid Joins: Join Query
SELECT "purchase"."id"
FROM "purchase"
INNER JOIN "user" ON ("purchase"."user_id" = "user"."id")
WHERE "user"."account_id" IN
(SELECT generate_series(1,1000));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment