select ${type} as '类型',b.'店铺名称1'as'店铺名称',sum(订单总数1) as '订单总数',sum(订单总金额1) as'订单总金额' from (SELECT FROM_UNIXTIME(st.pay_time,'%Y-%m-%d')AS'日期', COUNT(st.tid)'订单总数1' ,SUM(st.total_fee+st.post_fee)'订单总金额1',ss.shop_name'店铺名称1',FROM_UNIXTIME(st.pay_time,'%Y-%m')as'月份',FROM_UNIXTIME(st.pay_time,'%Y')as '年份' from systrade_trade st LEFT JOIN sysshop_shop ss ON st.shop_id=ss.shop_id where ss.shop_name like '%联盛超市%' AND FROM_UNIXTIME(st.pay_time,'%Y-%m-%d')>='2018-12-06' and st.`status` in ('WAIT_SELLER_SEND_GOODS','WAIT_BUYER_CONFIRM_GOODS','TRADE_FINISHED','TRADE_CLOSED') and st.tid in (select tid from systrade_order where title not like '%测试%' ) and st.receiver_name!='测试' GROUP BY ss.shop_name, FROM_UNIXTIME(st.pay_time,'%Y-%m-%d'),FROM_UNIXTIME(st.pay_time,'%Y-%m'),FROM_UNIXTIME(st.pay_time,'%Y'))b group by ${type} 我想按照年月日这样,划分店铺销量的,但是这样查询店铺名称提示错误,有没有高手点拨下啊, |