When using leftjion to connect a table to the left, and the primary and secondary tables are one-to-many, resulting in duplicate data in the result set, in order to remove duplicate data, I intend to use group by to remove duplicate data by grouping. When the following error message appears:
Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated
column 'loser.tank_admin.login_ip' which is not functionally dependent on columns in
GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
Through the last sentence we know that using group by is contradictory to sql_mode=only_full_group_by.
Currently you can refer to the following article:
Sql_mode=only_full_group_by study
MySQL 5.7 default ONLY_FULL_GROUP_BY semantic introduction
Today, I popped up a prompt when I created the table with my own mysql: At that time, I gave me a whole face. I thought that my SQL was wrong. I repeatedly checked the SQL I wrote and found that there...
my situation : Mysql 5.7.21 version runs sql and reports the same error. The same sql runs directly locally without error. However, this error occurs when connecting to Mysql on the server (even runni...
Original link: https://blog.csdn.net/loveliness_peri/article/details/88051316 The reason for the problem: there are more in sql_mode:ONLY_FULL_GROUP_BY Use SQL statements to query this configur...
When using MySQL to perform Group By query statement, error: problem causes The SQL standard does not allow the Select list, a Having condition statement, or a grouse in the Group By in the Order by s...
Scenario: The same product, different models, there are different prices, such as 1 mobile phone has 128G, 2,256g, 2500 yuan, but the product display page, the price shows 2,000 yuan, if it is a produ...
Error message solve I encountered a SQ pit today, recorded, longji Inappropriate reason Mainly group problems caused, the previous use of the list query, I thought it was a joint watch could not use G...
Solution: 1. View: show result: SET deletes ONLY_FULL_GROUP_BY 2. Modify sql_mode 3. Check the verification again and the modification is successful. The results are as follows: The problem is solved ...
mysql5.7 + version is turned on by defaultonly_full_group_byMode,When you turn on this mode, the column must query conditions are grouped. The original group by statement will be reported this error. ...
Solution: modify the mysql configuration file The local server can modify this Add under [mysqld] Then restart service mysql restart ...
Error scenario Today, I have a project that I just came down on my computer. When I log in to enter the home page, I reported a string of this is incompatible with sql_mode = only_full_group_by error,...