【发布时间】:2012-08-22 11:08:48
【问题描述】:
find_by_sql("SELECT s.productcode, s.description, CAST(SUM(l.amount) as UNSIGNED) AS amount FROM softwares s LEFT JOIN licenses l ON s.id=l.software_id GROUP BY s.productcode, s.description WHERE s.supplier= 'softcat'")
我目前有这个,我收到错误ActiveRecord::StatementInvalid in SoftwaresController#export_softcat
我正在尝试在末尾添加一个 where 子句,以仅选择特定供应商的记录。
【问题讨论】:
标签: mysql ruby-on-rails activerecord where-clause