Jeg går ud fra, at du ønsker at få sum og ang for datoerne
SELECT sum(col2) AS sum
,CASE
WHEN sum(col2 * col3) = 0
THEN 0
ELSE sum(col2 * col3) / sum(col2) AS avg
,DATE GROUP BY DATE
Jeg går ud fra, at du ønsker at få sum og ang for datoerne
SELECT sum(col2) AS sum
,CASE
WHEN sum(col2 * col3) = 0
THEN 0
ELSE sum(col2 * col3) / sum(col2) AS avg
,DATE GROUP BY DATE