参考代码 SELECT product_id, if(count(*)=0,0,round(sum(if_click)/count(*),3))ctr, if(sum(if_click)=0,0,round(sum(if_cart)/sum(if_click),3))cart_rate, if(sum(if_cart)=0,0,round(sum(if_payment)/sum(if_cart),3))payment_rate, if(sum(if_payment)=0,0,ro...