如何使用SQL查询跨平台崩溃数据 - 结合log_iOS_crash和log_android_crash
如何使用SQL查询跨平台崩溃数据 - 结合log_iOS_crash和log_android_crash \u003cbr\u003e\u003cbr\u003e 为了方便查询跨平台崩溃数据,可以新增数据表log_android_crash,并结合log_iOS_crash进行查询。\u003cbr\u003e 首先,你需要新增数据表log_android_crash,可以使用以下SQL语句:\u003cbr\u003e \u003cbr\u003e sql\u003cbr\u003e CREATE TABLE log_android_crash (\u003cbr\u003e crash_uuid VARCHAR(255),\u003cbr\u003e -- 其他列...\u003cbr\u003e );\u003cbr\u003e \u003cbr\u003e \u003cbr\u003e 接着,可以使用以下SQL语句在log_android_crash和log_iOS_crash两个表中进行查询:\u003cbr\u003e \u003cbr\u003e sql\u003cbr\u003e SELECT \u003cbr\u003e crash_uuid,\u003cbr\u003e COUNT(crash_uuid),\u003cbr\u003e PlatformType\u003cbr\u003e FROM (\u003cbr\u003e SELECT \u003cbr\u003e ios.crash_uuid,\u003cbr\u003e ios.PlatformType\u003cbr\u003e FROM log_iOS_crash ios\u003cbr\u003e JOIN log_iMonkey_Wechat_overview o ON ios.crash_uuid = o.CrashIdentifier\u003cbr\u003e WHERE ios.crash_uuid IN (\u003cbr\u003e SELECT DISTINCT CrashIdentifier\u003cbr\u003e FROM log_iMonkey_Wechat_overview\u003cbr\u003e WHERE Debug = 0\u003cbr\u003e AND PlatformType != 0\u003cbr\u003e AND CrashIdentifier != ''\u003cbr\u003e AND Ds >= toDateTime(#wechat_crash_level_time.start#)\u003cbr\u003e AND Ds <= toDateTime(#wechat_crash_level_time.end#)\u003cbr\u003e GROUP BY PlatformType, CrashIdentifier\u003cbr\u003e )\u003cbr\u003e \u003cbr\u003e UNION ALL\u003cbr\u003e \u003cbr\u003e SELECT \u003cbr\u003e android.crash_uuid,\u003cbr\u003e android.PlatformType\u003cbr\u003e FROM log_android_crash android\u003cbr\u003e LEFT JOIN log_iMonkey_Wechat_overview o ON android.crash_uuid = o.CrashIdentifier\u003cbr\u003e WHERE android.crash_uuid IN (\u003cbr\u003e SELECT DISTINCT CrashIdentifier\u003cbr\u003e FROM log_iMonkey_Wechat_overview\u003cbr\u003e WHERE Debug = 0\u003cbr\u003e AND PlatformType != 0\u003cbr\u003e AND CrashIdentifier != ''\u003cbr\u003e AND Ds >= toDateTime(#wechat_crash_level_time.start#)\u003cbr\u003e AND Ds <= toDateTime(#wechat_crash_level_time.end#)\u003cbr\u003e GROUP BY PlatformType, CrashIdentifier\u003cbr\u003e )\u003cbr\u003e AND o.CrashIdentifier IS NULL\u003cbr\u003e ) result\u003cbr\u003e GROUP BY crash_uuid, PlatformType\u003cbr\u003e \u003cbr\u003e \u003cbr\u003e 这个查询将在log_iOS_crash和log_android_crash两个表中进行联合查询,并根据条件过滤数据。当log_iOS_crash.crash_uuid不等于log_iMonkey_Wechat_overview.CrashIdentifier时,就会从log_android_crash表中查询。最后,按照crash_uuid和PlatformType进行分组。\u003cbr\u003e \u003cbr\u003e 希望以上信息对您有所帮助。\u003cbr\u003e
原文地址: https://www.cveoy.top/t/topic/pJmd 著作权归作者所有。请勿转载和采集!