当前位置:网站首页>“Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated
“Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated
2022-04-23 07:22:00 【qq_ fifteen million one hundred and ninety-seven thousand four 】
Problem description
sql:
SELECT ID ,COUNT(ID) as favoriteCount,productID FROM l_favorite GROUP BY productID
Report errors :
MySql.Data.MySqlClient.MySqlException:“Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘lec.l_favorite.ID’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by”
Cause analysis :
It felt strange at first , Run in the database management tool without error ,EF You'll report a mistake again . And there are times mistakes , Sometimes they don't report .
First, I directly searched the error content , Then a bunch of articles are written directly , Get rid of mysql In the configuration file sql_mode=ONLY_FULL_GROUP_BY To configure .
It's very speechless , Don't say the reason for the error , It doesn't solve the problem , Directly solve the configuration items that generate errors , Since the default configuration is like this , That must make sense , Don't change the configuration easily , It's not a good habit .
Then translated this paragraph in English , Probably means to say ID This field has no aggregation .
Well, … Looked at the sql, I'm careless , many select There's a ID Field , And the grouping field is productID . Cause the database to think , Put several different ID Aggregate into one ID, It's illegal .
Solution :
hold select There is no aggregation behind ID Just remove the field .
版权声明
本文为[qq_ fifteen million one hundred and ninety-seven thousand four ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230609264857.html
边栏推荐
- Pytorch best practices and coding style guide
- Raspberry Pie: two color LED lamp experiment
- Chapter 5 fundamentals of machine learning
- 第4章 Pytorch数据处理工具箱
- N states of prime number solution
- 免费使用OriginPro学习版
- Compression and acceleration technology of deep learning model (I): parameter pruning
- Solution to slow compilation speed of Xcode
- How to standardize multidimensional matrix (based on numpy)
- 【動態規劃】不同路徑2
猜你喜欢
Chapter 4 pytoch data processing toolbox
【点云系列】Multi-view Neural Human Rendering (NHR)
[point cloud series] a rotation invariant framework for deep point cloud analysis
Machine learning II: logistic regression classification based on Iris data set
[recommendation of new books in 2021] practical IOT hacking
Gephi教程【1】安装
[point cloud series] sg-gan: advantageous self attention GCN for point cloud topological parts generation
Machine learning notes 1: learning ideas
【点云系列】点云隐式表达相关论文概要
【点云系列】 A Rotation-Invariant Framework for Deep Point Cloud Analysis
随机推荐
WinForm scroll bar beautification
Summary of image classification white box anti attack technology
Component learning (2) arouter principle learning
Miscellaneous learning
Component based learning (1) idea and Implementation
PyTorch 22. PyTorch常用代码段合集
Cancel remote dependency and use local dependency
Android interview Online Economic encyclopedia [constantly updating...]
Project, how to package
Gephi tutorial [1] installation
Component based learning (3) path and group annotations in arouter
[point cloud series] sg-gan: advantageous self attention GCN for point cloud topological parts generation
第2章 Pytorch基础1
Gee configuring local development environment
Reading notes - activity
Mysql database installation and configuration details
How keras saves and loads the keras model
PyTorch训练一个网络的基本流程5步法
【点云系列】Learning Representations and Generative Models for 3D pointclouds
Chapter 2 pytoch foundation 2