页面截图:
相关代码
页面跳转报错:
SQL语句执行错误:select a.* from (select album, addtime, id from blog_kl_album order by album, addtime desc, id desc) a group by album
Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'a.addtime' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
«点击返回;)
求助,怎么写能正常运行呢,MYSQL版本5.7.14
在高版本的的 MySQL 中,严格了当使用
group by
时,column
必须出现在group by
后面或者,使用聚合函数。解决方法
a.*
下的所有字段使用any_value(column) as column
的形式括起来。2、跳转 MySQL 的
sql_mode
。 参考如下。