Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Product.joins(guides: :documents).distinct
- SELECT DISTINCT "products".* FROM "products"
- INNER JOIN "guides" ON "guides"."product_id" = "products"."id"
- INNER JOIN "documents" ON "documents"."guides_id" = "guides"."id"
Add Comment
Please, Sign In to add comment