根据错误信息,问题出在缺少列'CrashIdentifier',可能是在FROM子查询中引用了错误的列名。请检查log_iOS_crash和log_android_crash表,确保使用正确的列名和表名。

另外,也要确保在FROM子查询中使用的时间范围(#day_wechat_crash_time.start#和#day_wechat_crash_time.end#)是正确的,并且与主查询中的时间范围(#day_wechat_crash_time.start#和#day_wechat_views_time.end#)一致。

以下是修改后的SQL查询:

SELECT PlatformType AS PlatformType, (CASE WHEN PlatformType IN (1, 3, 5, 7) THEN ( SELECT COUNT(crash_uuid) FROM log_iOS_crash WHERE crash_uuid = log_iMonkey_Wechat_overview.CrashIdentifier AND Ds >= toDateTime(#day_wechat_crash_time.start#) AND Ds <= toDateTime(#day_wechat_crash_time.end#) ) WHEN PlatformType IN (2, 4, 6, 8) THEN ( SELECT COUNT(crashid) FROM log_android_crash WHERE crashid = log_iMonkey_Wechat_overview.CrashIdentifier AND Ds >= toDateTime(#day_wechat_crash_time.start#) AND Ds <= toDateTime(#day_wechat_crash_time.end#) ) ELSE 0 END) AS index_crashcount_0 FROM log_iMonkey_Wechat_overview WHERE Debug = 0 AND PlatformType != 0 AND CrashIdentifier != '' AND Ds >= toDateTime(#day_wechat_crash_time.start#) AND Ds <= toDateTime(#day_wechat_views_time.end#) GROUP BY PlatformType ORDER BY index_crashcount_0 DESC LIMIT 500

SELECT PlatformType AS PlatformType CASE WHEN PlatformType IN 1 3 5 7 THEN SELECT COUNTcrash_uuid FROM log_iOS_crash WHERE crash_uuid = CrashIdentifier AND Ds = toDateTime#

原文地址: http://www.cveoy.top/t/topic/hZF9 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录