Ask A Question


You’re not receiving notifications from this thread.

How to write this raw SQL query in Active Record Query Interface

W.M. asked in Rails

Here's the SQL:

select,, count( as count from items i
left join products p
on = i.product_id
left join stores s
on = i.store_id
group by,

Thank you.

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 78,890+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

    © 2023 GoRails, LLC. All rights reserved.