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 子句,只选择某个供应商的记录。