with t1 as(select date(visit_time) as date,count(distinct user_id) as visits from visit_tb group by date(visit_time) ), t2 as(select date(order_time) as date,count(distinct user_id) as orders from order_tb group by date(order_time) ) select t1.date,concat(round((orders/visits)*100,1),'%') as cr from t1 left join t2 on t1.date=t2.date order by t1.date
我自己解答出来了难题!我太厉害了!

京公网安备 11010502036488号