I have the following table.
mysql> select * from consumer9;
+------------+--------------+-------------------+
| Service_ID | Service_Type | consumer_feedb
Use the having
clause instead of where
SELECT Service_ID, Service_Type, SUM(consumer_feedback)
FROM consumer9
GROUP BY Service_ID
HAVING Service_Type='Printer';
Regards.
The following query should work.
select Service_ID, Service_Type, sum(consumer_feedback)
from consumer9
where Service_Type=Printer
group by Service_ID, Service_Type;
Remember, the where clause goes before the group by clause and all non-aggregated terms in the select part will have to be present in the group by clause.