首先要确定你重复的记录最多有多少条,我这里假设最多有两条重复customerid的记录
select
customerId,
case when count(*)>=2 then 2 else max(type) end as type,
sum(orderNum) as orderNum,
SUBSTRING_INDEX(group_concat(shkd),',',1) as shkd,
SUBSTRING_INDEX(group_concat(srmb),',',1) as srmb,
S
2024-11-07