SELECT toStartOfDaytoDateTimeDs AS datetime_day_Ds AppIdentifier AS AppIdentifier sumAvgDeviceTime AS index_avgdevicetime_0 sumAvgDeviceTime count AS index_avgdevicetime_0修改代码有多条数据时index_avgdevic
SELECT toStartOfDay(toDateTime(Ds)) AS datetime_day_Ds, AppIdentifier AS AppIdentifier, CASE WHEN count() > 1 THEN sum(AvgDeviceTime) / count() ELSE sum(AvgDeviceTime) END AS index_avgdevicetime_0 FROM table_name GROUP BY datetime_day_Ds, AppIdentifier
原文地址: https://www.cveoy.top/t/topic/iGzJ 著作权归作者所有。请勿转载和采集!