SELECT a.product_id, ROUND(IFNULL(repurchase_num/people_cnt,0),3) repurchase_rate FROM tb_product_info a LEFT JOIN # 要保留复购率为0的,那就用左链接去匹配出那些count为0的product,然后把null转化为0 (SELECT t1.product_id, t1.people_cnt, t2.r...