广告sql:
SELECT sum(total) FROM report_payment WHERE description='Cost of Advertising' AND date_time>='2020-09-1 0:0:0' AND date_time<'2020-10-1 0:0:0';
sku产品订单,销量
SELECT count(1),sum(quantity) FROM report_payment WHERE sku='HSS8G-100LG8L-WW' AND date_time>='2020-09-1 0:0:0' AND date_time<'2020-10-1 0:0:0';
sku产品销售额,总计
SELECT sum(product_sales),sum(total) FROM report_payment WHERE sku='HSS8G-100LG8L-WW' AND date_time>='2020-09-1 0:0:0' AND date_time<'2020-10-1 0:0:0';
sku退货数
SELECT sum(quantity) FROM report_payment WHERE sku='HSS8G-100LG8L-WW' AND type='Refund' AND date_time>='2020-09-1 0:0:0' AND date_time<'2020-10-1 0:0:0';
网友评论