I have two models:
- Product
- Click
I would like to get all products that have more than x clicks.
The tables looks like this:
Products
id
,
Clicks
id | product_id
In ruby, the code might look like products.select {|p| p.clicks.size > x}. How might one write a similar query for mysql?
Thanks!