更新:看起来像是强制报警,我误解了我的结果集,实际上查询返回它应该返回的结果。哎呀。非常感谢大家的帮助!
我的问题怎么了?产生了错误的结果。
SELECT
utm_source as source,
utm_medium as medium,
utm_campaign as campaign,
utm_content as content,
COUNT(order_id) as orders,
COUNT(DISTINCT _customer_user) as customers,
SUM(_order_total) as revenue,
SUM(_refund_amount) as refunded,
SUM(_order_total) - SUM(_refund_amount) as net,
(SUM(_order_total) - SUM(_refund_amount))/COUNT(DISTINCT _customer_user) as 'average ticket'
FROM wp_realtime_utm_tracking_utms
GROUP BY source, medium, campaign, content
1条答案
按热度按时间jyztefdp1#
你能试试这个查询吗?