Guest User

Untitled

a guest
Oct 18th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. Product.joins(guides: :documents).distinct
  2.  
  3. SELECT DISTINCT "products".* FROM "products"
  4. INNER JOIN "guides" ON "guides"."product_id" = "products"."id"
  5. INNER JOIN "documents" ON "documents"."guides_id" = "guides"."id"
Add Comment
Please, Sign In to add comment