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