2017-02-19から1日間の記事一覧
Base.connection.select_all あたりは細かく知りたい hash = ActiveRecord::Base.connection.select_all("select sum(sub1.diff) from (select diff from differences order by created_at desc limit 5) sub1").to_hash puts hash[0]["diff"]
Base.connection.select_all あたりは細かく知りたい hash = ActiveRecord::Base.connection.select_all("select sum(sub1.diff) from (select diff from differences order by created_at desc limit 5) sub1").to_hash puts hash[0]["diff"]