055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'basedb.tcd.sale_day' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
解答: 这个语句的报错意思是:
order by的字段 没有在group by 字段之中。调整sql语句,在group by 字段中加上order by 或去掉order by 。
测试版数据库 5.7.25-log 版本,线上5.7.27 版本 ,因为版本不同, 5.7.25-log sql执行成功, 5.7.27上 sql报错。
推荐更高级的版本,修正sql已经即可。