In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Reason:
MySQL 5.7.5 and up implement the detection of functional dependencies. If only_full_group_by SQL mode is enabled (as is the default), MySQL rejects queries referenced by lists, conditions, or sequential lists that reference unnamed non-aggregate columns in the group, rather than relying on them functionally. Prior to 5.7.5, MySQL did not detect functional dependencies, and only_full_group_by was not enabled by default. For a description of the previous 5.7.5 behavior, see the MySQL 5.6 reference manual.)
Execute the following command to view the contents of sql_mode:
Mysql > SHOW SESSION VARIABLES;mysql > SHOW GLOBAL VARIABLES;mysql > select @ @ sql_mode
It can be seen that the values of sql_mode for both session and global are:
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Only_full_group_by description:
Only_full_group_by: to use this is to use the same group rules as oracle. The columns of select must be in group, or they must be SUM,AVG,MAX,MIN. In fact, this configuration is similar to distinct at present, so it is good to remove it.
Resolve:
Set global sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';set session sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
Summary
The above is introduced by the editor to solve the group error report Expression # 1 of SELECT list is not in GROUP BY clause and contains nonaggregated of the larger than 5.7version of mysql. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to the website!
If you think this article is helpful to you, you are welcome to reprint it, please indicate the source, thank you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.