Thank you, I got it.
2015年1月20日火曜日 5時55分31秒 UTC+9 Daniel Loureiro:
>
> Try this:
>
> Sola::Dayly.group(:month).maximum(:peak_kw)
>
>
> *Explanation:*
> "find_by_sql" is to be used to get real records, not database
> calculations. The "Group", "Max" and other statements produce calculations,
>
Try this:
Sola::Dayly.group(:month).maximum(:peak_kw)
*Explanation:*
"find_by_sql" is to be used to get real records, not database calculations.
The "Group", "Max" and other statements produce calculations, not real
records.
If you want to do a *raw SQL*, do with "
*ActiveRecord::Base.connect
2 matches
Mail list logo