select product_id, ifnull(round(sum(if_click)/count(product_id),3),0) as ctr, ifnull(round(sum(if_cart)/sum(if_click),3),0) as cart_rate, ifnull(round(sum(if_payment)/sum(if_cart),3),0) as payment_rate, ifnull(round(sum(if_refund)/sum(if_payment),3),0) as refund_rate from tb_user_event where d...