420001055 Expression #7 of SELECT list is not in GROUP BY clause and contains nonaggregated column tbtotalTimespan which is not functionally dependent on columns in GROUP BY clause; this is incompatib
这个错误是由于sql_mode设置为only_full_group_by导致的。这种模式要求在GROUP BY子句中的每个列都必须是聚合函数或者GROUP BY子句中的列。
在你的查询中,SELECT列表中的第7个表达式totalTimespan没有在GROUP BY子句中,并且它不是函数依赖于GROUP BY子句中的列。因此,这个查询与only_full_group_by模式不兼容。
要解决这个问题,你可以将totalTimespan添加到GROUP BY子句中,或者使用聚合函数(如SUM、AVG等)来计算totalTimespan。
原文地址: http://www.cveoy.top/t/topic/iHuv 著作权归作者所有。请勿转载和采集!