题解 | #某宝店铺的实际销售额与客单价#
某宝店铺的实际销售额与客单价
https://www.nowcoder.com/practice/b3a0731dfd654361943916d8d85699cd
select sum(sales_price) as sales_total, round(sum(sales_price)/max(user_id),2) as per_trans from sales_tb
id是自增长没有缺失值就可以max 否则需要 count(distinct user_id)