Hi,

>         如:select sum(distinct b,c) from orders group by a,w
sum function 的入参只能是一个,没太明白你的需求,如果是简单的去重,group by 所有需要去重的字段就可以去重:
   .groupBy("a,b,c w")
   .select("a, b, c”);

如果是group by分组还需要对非分组字段去重做聚合,那直接:

 .groupBy("a, w")
  .select("a, b.sum.distinct, c.sum.distinct”);

Best,
Leonard Xu

> 
> 非常感谢!
> 
> ________________________________
> [email protected]
> ________________________________
> OPPO
> 
> 本电子邮件及其附件含有OPPO公司的保密信息,仅限于邮件指明的收件人使用(包含个人及群组)。禁止任何人在未经授权的情况下以任何形式使用。如果您错收了本邮件,请立即以电子邮件通知发件人并删除本邮件及其附件。
> 
> This e-mail and its attachments contain confidential information from OPPO, 
> which is intended only for the person or entity whose address is listed 
> above. Any use of the information contained herein in any way (including, but 
> not limited to, total or partial disclosure, reproduction, or dissemination) 
> by persons other than the intended recipient(s) is prohibited. If you receive 
> this e-mail in error, please notify the sender by phone or email immediately 
> and delete it!

回复