阅读更多
select group_concat(MchId separator ',') as mchIds,group_concat(ifnull(tag,'') separator ',') as tag,
AccountName,AccountNo,count(1)as count,sum(RemitAmount) as RemitAmount,sum(Amount) as Amount,
group_concat(Amount separator ',') as Amounts,group_concat(RemitAmount separator ',') as RemitAmounts,
group_concat(createTime separator ',') as cts,group_concat(updateTime separator ',') as uts,
group_concat(transOrderId separator ',') as toids,group_concat(agentpayOrderId separator ',') as apoids,
group_concat(agentpayChannel separator ',') as agentpayChannels FROM t_mch_agentpay_record WHERE 1 = 1
GROUP BY AccountNo
带出分组统计,分组需要的各个详情