tags: Database related SQL statement mysql database java

This problem occurs above Mysql5.7 because the default SQL configuration is: SQL_MODE = "Only_Full_Group_by".
select
t.category_no, any_value(t.game_name)
from
t_game t
group
t.category_no
set @@GLOBAL.sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Add this paragraph below [MySQLD] and [MySQL]
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Restart the database service
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,...
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 background 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...
WIN10 my.ini configuration: [mysqld] sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION" After restarting mysql, query select @@sql_...
Reason for error: In mysql8.0 and above, for this aggregation operation of group by, if the column in the select does not appear in the group by, then this SQL is illegal, because the column is not in...
When using MySQL, the following query is performed: The error message is as follows: The wrong reason is that my mysql version is 5.7, using the following statement query you know It is set by default...
wrong reason This is caused by the version features above MySQL5.7. solution Execute the following code Run and then you can, finish....
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...