用group by 查询时抛出如下异常:
Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'userinfo.t_long.user_name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
解决:
修改MySQL 配置文件 sql_mode,去掉only_full_group_by
参考博客:
https://www.cnblogs.com/jpfss/p/10401753.html
法二:
将select中的所有字段放到 group by 后面
参考博客:
https://blog.youkuaiyun.com/qq_41737716/article/details/80566407