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'")
I currently have this, and i get the error ActiveRecord::StatementInvalid in SoftwaresController#export_softcat
I'm trying to add a where clause on the end to only select the records with a certain supplier.