SQL 查询错误: 引用不存在的列 'datetime_day_Ds'
{"title":"SELECT \n -- toStartOfDay(toDateTime(Ds)) AS datetime_day_Ds,\n PlatformType AS PlatformType,\n sum(CrashCount) AS index_crashcount_0\nFROM log_iMonkey_Wechat_overview\nWHERE Debug = 0 AND PlatformType != 0 AND\n Ds >= toDateTime(#day_wechat_crash_time.start#)\n AND Ds <= toDateTime(#day_wechat_views_time.end#) \n \nGROUP BY datetime_day_Ds, PlatformType\nORDER BY datetime_day_Ds DESC, PlatformType DESC\nLIMIT 5000\n代码什么问题内容:在上述代码中,你注释掉了toStartOfDay(toDateTime(Ds)) AS datetime_day_Ds这一行,但在GROUP BY和ORDER BY子句中仍然引用了它。这将导致查询失败,因为引用了不存在的列。\n\n要解决这个问题,你可以取消注释toStartOfDay(toDateTime(Ds)) AS datetime_day_Ds这一行,或者在GROUP BY和ORDER BY子句中使用toStartOfDay(toDateTime(Ds))代替datetime_day_Ds来引用该列。"}
原文地址: https://www.cveoy.top/t/topic/pxH4 著作权归作者所有。请勿转载和采集!