79404160

Date: 2025-01-31 23:17:41
Score: 1
Natty:
Report link

This is an old question. An alternative workaround is to use logs and exponentials, where product(y)=exp(sum(ln(y))). As SQL:

with
  d as (select 1 as x, 3 as y union all select 1 as x, 4 as y)
  select x, sum(y) as sum_y, exp(sum(ln(y))) as prod_y from d group by x;

1|7|12.0
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: mclements