select product_id, if(count(id) = 0,0,round(sum(if_click)/count(id),3)) ctr, if(sum(if_click) = 0,0,round(sum(if_cart)/sum(if_click),3)) as cart_rate, if(sum(if_cart) = 0,0,round(sum(if_payment)/sum(if_cart),3)) as payment_rate, if(sum(if_payment) = 0,0,round(sum(if_refund)/sum(...