Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下查询
@entity = Unit.joins(:item).select('SUM((items.entity/items.amount*units.amount)) AS entity')
如何以更像轨道的方式做到这一点?
Unit.joins(:item).sum('items.entity/items.amount*units.amount')