SELECT toStartOfDaytoDateTimeDs AS datetime_day_Ds PlatformType AS PlatformType maxMergedUrlCount AS index_mergedviewcount_0 maxMergedViewCount AS index_mergedviewcount_1FROM log_iMonkey_Wechat_o
代码的问题在于以下几点:
-
在 WHERE 子句中,PlatformType in 3,4 的语法是不正确的。应该使用 PlatformType IN (3,4)。
-
在 WHERE 子句中,toDateTime(#day_wechat_views_time.start#) 和 toDateTime(#day_wechat_views_time.end#) 的语法也是不正确的。这里的 #day_wechat_views_time.start# 和 #day_wechat_views_time.end# 是占位符,应该根据具体的需求替换为实际的日期时间值。
正确的代码应该是:
SELECT toStartOfDay(toDateTime(Ds)) AS datetime_day_Ds, PlatformType AS PlatformType, max(MergedUrlCount) AS index_mergedviewcount_0, max(MergedViewCount) AS index_mergedviewcount_1 FROM log_iMonkey_Wechat_overview WHERE Debug = 0 AND PlatformType IN (3,4) AND Ds >= toDateTime('2022-01-01') AND Ds <= toDateTime('2022-01-31'
原文地址: https://www.cveoy.top/t/topic/hOtA 著作权归作者所有。请勿转载和采集!