Project Startup Error: only_full_group_by

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 项目启动报错only_full_group_by

| username: 小于同学

[Test Environment for TiDB]
[TiDB Version]
[Reproduction Path] Operations added a new database
[Encountered Issue: Problem Phenomenon and Impact] Error reported when starting the project
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachment: Screenshot/Log/Monitoring]

| username: caiyfc | Original post link

You can bypass this issue by modifying the SQL mode, but it will lead to unstable result sets. You can refer to the following article: Column - TiDB Database Development Specification | Unstable Result Sets

| username: TiDBer_RjzUpGDL | Original post link

There is an issue with the SQL.

| username: Kongdom | Original post link

It is recommended to find the corresponding SQL statement and modify it according to the instructions.

| username: zhanggame1 | Original post link

Modifying the SQL mode can solve the issue, but the SQL with this problem is generally not well-written. It’s better to change the SQL.

| username: zhaokede | Original post link

This is a business SQL error, right?

| username: YuchongXU | Original post link

There should be a problem with the business SQL.

| username: dba远航 | Original post link

Modify the SQL mode to bypass this issue.

| username: 霸王龙的日常 | Original post link

After MySQL 5.7, MySQL has SQL_MODE strict mode enabled by default, which performs strict data validation. TiDB has also inherited this mode. If the code contains group by aggregation operations, then the columns in the select statement, except those using aggregate functions like max() and min(), must appear in the group by clause.
Strictly speaking, this is non-standard SQL. You can modify the SQL or avoid it by setting sql_mode and removing ONLY_FULL_GROUP_BY.

| username: DBAER | Original post link

sql_mode issue,

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.