Invalid use of group function Invalid use of group function
The phenomenon of
Oracle executes double-layer sum without Invalid use of group function, executes the same SQL to mysql, and Invalid use of group function
find the cause
check correct
SELECT [DISTINCT|DISINCTROW|ALL] select_expression,... -- Query results
[FROM table_references -- specify the table for the query
[WHERE where_definition] -- where clause, the filtering condition of the query data
[GROUP BY col_name,...] -- group the query results [that match the where clause]
[HAVING where_definition] -- condition on the grouped results
[ORDER BY{unsigned_integer | col_name | formula} [ASC | DESC],...] -- Sort the query results
[LIMIT [offset,] rows] -- Limit the number of rows to be displayed for a query
[PROCEDURE procedure_name] -- query the result set data returned by the procedure
]
Take a closer look at SQL to locate the two-layer SUM cause
Modify separate SUM, problem solved, the outermost package of a layer
Read More:
- How to Solve MySQL version 5.7+ Group by group error
- [MySQL] The principle of group by aggregation function and the reason for aggregation limitation SELECT list is not in GROUP BY clause and contains nonaggregated column
- [Two Methods] Ora-00904: invalid group by error identifier
- [Solved] Sequelize DatabaseError: ER_WRONG_FIELD_WITH_GROUP: Expression #2 of SELECT list is not in GROUP
- [Solved] MySQL Error: ERROR 1055 (42000)sql_mode=only_full_group_by
- [Solved] MySQL Error: “Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre”
- [Solved] MYSQL 5.7 gruop by eRROR: this is incompatible with sql_mode=only_full_group_by
- MYSQL gruop by Error: this is incompatible with sql_mode=only_full_group_by
- [Solved] MYSQL Start Project Error: this is incompatible with sql_mode=only_full_group_by
- How to Solve mysql [Err] 1067-Invalid default value for
- [Solved]ERROR 1067 (42000): Invalid default value for ‘end_time‘ Mysql
- MYSQL: How to Use ifnull()
- [Solved] MySQL5.6.44 [Err] 1067 – Invalid default value for create_date settlement programme
- Mysql ERROR 1067: Invalid default value for ‘date’ [How to Solve]
- Idea connect mysql error Server returns invalid timezone. Go to’Advanced’ tab and set’serverTimezone’ property
- Mysql Flashback Warning: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe
- SQL Server Group sort de duplication row_ number() over ( PARTITION BY t1.col_ 2 ORDER BY 1 )
- MYSQL Create TIMESTAMP and Save Error: ERROR 1067 (42000): Invalid default value for ‘last_updated_on’
- [Solved] ERROR 2002 (HY000): Can’t connect to local MySQL server through socket’/var/lib/mysql/mysql.sock’ (2)
- [Solved] Anaconda Error: pyqt can’t use QSqlDatabase to connect to MySQL