Error:
Cannot perform an aggregate function on an expression containing an aggregate or a subquery
The part where the error occurred:
SELECT column_1, column_2,
SUM(CASE WHEN column_2 NOT IN (SELECT product FROM table_products) THEN 1
ELSE 0
END) AS Total
FROM my_table
WHERE is_rated = '1'
GROUP BY column_1, column_2
Can someone please help me with this?