,sumIf(fees[1],fees[1]>0 and deleted = 0 ) as fees
,sumIf(fees[1],fees[1]<0 and deleted = 0 ) as corrects
я получаю DB::Exception: Aggregate function sumIf(arrayElement(fees, 1), and(greater(arrayElement(fees, 1), 0), equals(deleted, 0))) is found inside another aggregate function in query. ?
Да, попробуйте заменить sumIf(fees[1],fees[1]>0 and deleted = 0 ) as fees на sumIf(fees[1],fees[1]>0 and deleted = 0 ) as fees_new
Обсуждают сегодня