tags: MySQL
It is because only_full_group is configured in sql_mode in the default MySQL configuration, which requires GROUP BY
Contains all the fields that appear in the SELECT.
only_full_group_by description:
only_full_group_by: To use this is to use the same group rules as Oracle,
The select column must be in the group, or it is an aggregate column (SUM, AVG, MAX, MIN).
In fact, this configuration currently personally feels similar to distinct, so just remove it
SELECT * FROM table name GROUP BY field
1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains
nonaggregated column 'XXX' which is not functionally dependent on columns
in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
Use SQL statements to query this configuration:
select @@sql_mode;

Solution: Add the corresponding setting in the configuration file: (is to execute the query sql_mode statement above; removeONLY_FULL_GROUP_BYCan)
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

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,...
Report error message: Reporting error Mysql 5.7.5 and above function dependencies. If ONLY_FULL_GROUP_BY is enabled SQL Mode (By default), MySQL will refuse to select a list, the Having condition, or ...
problem: the reason: solve:...
The specific errors are as follows: the reason: MySQL 5.7.5 and above functions depend on the detection function. If ONLY_FULL_GROUP_BY SQL mode is enabled (by default), MySQL will reject select lists...
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...
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...
Recently Mysql prompts an error when using groupby query1055 this is incompatible with sql_mode=only_full_group_by I checked N posts and found that after MySQL 5.7.5, ONLY_FULL_GROUP_BY was turned on ...
Today I wrote such a SQL statement in Mysql on my personal server: The execution even reported an error, the error information is as follows: My Mysql version is 5.7.22, which was newly installed when...
environment Execute the query statement Report an error reason: MySQL 5.7.5 and above functions rely on detection function Solution After setting, if it does not take effect, you can exit and log in a...