Solve the MySQL 5.7.9 version sql_mode=only_full_group_by problem

Solve the MySQL 5.7.9 version sql_mode=only_full_group_by problem

MySQL 5.7.9 version sql_mode=only_full_group_by issue

When using the GROUP BY statement to query, the error com.MySQL.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'col_user_6.a.START_TIME' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by occurs

Solution:

Execute SET GLOBAL sql_mode = ''; to change sql_mode to a mode other than only_full_group_by.

Verify that SELECT @@GLOBAL.sql_mode or SELECT @@sql_mode is in effect

SET sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE

The above is the editor's introduction to solving the MySQL 5.7.9 version sql_mode=only_full_group_by problem. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Reasons and solutions for MySQL sql_mode modification not taking effect
  • Detailed explanation of MySQL sql_mode query and setting
  • Detailed explanation of viewing and setting SQL Mode in MySQL
  • Detailed explanation of sql_mode mode example in MySQL
  • Django2 connects to MySQL and model test example analysis
  • Detailed explanation on reasonable settings of MySQL sql_mode
  • MySQL sql_mode analysis and setting explanation
  • The pitfalls and solutions caused by the default value of sql_mode in MySQL 5.7
  • The perfect solution for MySql version problem sql_mode=only_full_group_by
  • Detailed explanation of SQL Mode usage in MySQL
  • mysql sql_mode="" function description
  • Detailed explanation of the use of MySQL sql_mode

<<:  JS realizes the calculation of the total price of goods in the shopping cart

>>:  Solution to nginx hiding version number and WEB server information

Recommend

How to deploy the crownblog project to Alibaba Cloud using docker

Front-end project packaging Find .env.production ...

Tomcat maxPostSize setting implementation process analysis

1. Why set maxPostSize? The tomcat container has ...

HTML table tag tutorial (25): vertical alignment attribute VALIGN

In the vertical direction, you can set the row al...

Differences between this keyword in NodeJS and browsers

Preface Anyone who has learned JavaScript must be...

Windows 2016 Server Security Settings

Table of contents System update configuration Cha...

A detailed introduction to JavaScript primitive values ​​and wrapper objects

Table of contents Preface text Primitive types Pr...

js implements the classic minesweeper game

This article example shares the specific code of ...

7 Ways to Write a Vue v-for Loop

Table of contents 1. Always use key in v-for loop...

Example code for implementing image adaptive container with CSS

There is often a scenario where the image needs t...

Detailed explanation of Linux netstat command

Table of contents Linux netstat command 1. Detail...