SELECT PlatformType AS PlatformType CrashIdentifier CrashContent2 AS stackFROM log_iMonkey_Wechat_overviewWHERE Debug = 1 AND PlatformType != 0 AND CrashIdentifier != AND toDateminDs = subt
您可以尝试将min(Ds)移到HAVING子句中,如下所示:
SELECT
PlatformType AS PlatformType,
CrashIdentifier,
CrashContent2 AS stack
FROM log_iMonkey_Wechat_overview
WHERE Debug = 1 AND PlatformType != 0 AND CrashIdentifier != ''
HAVING toDate(min(Ds)) >= subtractDays(toDate(now()), 1)
GROUP BY PlatformType, CrashIdentifier, CrashContent2
ORDER BY PlatformType DESC;
这样做可以将min(Ds)的计算放在GROUP BY子句之后进行,并且可以使用聚合函数进行筛选。
原文地址: https://www.cveoy.top/t/topic/i5Ub 著作权归作者所有。请勿转载和采集!