weixin_39654322 2020-11-30 15:26 采纳率: 0%
浏览 0

Incorrect query results and problems with FULL GROUP BY

I noticed that I was getting an invalid mapping of hostname_max and db_max after adding them to the query.

It appears that the GROUP BY is not properly grouping the data.

If I turn on FULL GROUP BY then I get an error message from MySQL.


Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'slow_query_log.dimension.sample' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (1055)

该提问来源于开源项目:box/Anemometer

  • 写回答

5条回答 默认 最新

  • weixin_39654322 2020-11-30 15:26
    关注

    These two columns get added to the query

    sql
      MAX(hostname_max) AS hostname_max,
      MAX(db_max) AS db_max,
    
    评论

报告相同问题?