SELECT min_Ds as Ds countdistinct appid as app_count FROM select AppIdentifier as appid minDs as min_Ds from log_iMonkey_iOS_overview
您可以尝试将PlatformType转换为字符串类型,以便与AppIdentifier的数据类型匹配。请尝试以下修改后的代码:
SELECT min_Ds AS Ds,
COUNT(DISTINCT appid) AS app_count
FROM (
SELECT AppIdentifier AS appid,
min(Ds) AS min_Ds
FROM log_iMonkey_iOS_overview
GROUP BY AppIdentifier
UNION ALL
SELECT AppIdentifier AS appid,
min(Ds) AS min_Ds
FROM log_iMonkey_Android_overview
GROUP BY AppIdentifier
UNION ALL
SELECT CAST(PlatformType AS String) AS appid,
min(Ds) AS min_Ds
FROM log_iMonkey_Android_overview
GROUP BY PlatformType
) subquery
请注意,我在第三个子查询中使用了CAST(PlatformType AS String)将PlatformType转换为字符串类型。这样,所有三个子查询返回的数据类型就会一致,避免了类型不匹配的错误
原文地址: https://www.cveoy.top/t/topic/h9yc 著作权归作者所有。请勿转载和采集!