sql聚合函数嵌套问题 aggregate function cannot contain aggregate parameters
在需求的应用场景,需要对create_time字段求最小值并求和,刚开始理所当然写成像下面这样:SUM(COALESCE(CASEWHENMIN(crl.create_time)BETWEENdate_add(date_sub(current_date(),1),-1*(open_case_day_num%6))ANDcurrent_date()ANDcrl.approval_statusin('