📜  rails 中的最后选择 - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:28.608000             🧑  作者: Mango

代码示例1
Statistic.joins("inner join (select customer_id,max(created_at) as created_at from statistics group by customer_id) as stats2 on statistics.customer_id = stats2.customer_id and statistics.created_at = stats2.created_at").pluck("max(statistics.sold_items)")