Group by using a query in Mysql when the following error occurs:
Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'GT_SIGNATURE_STU.SINGN_STU_ID' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
In the error was found, it has a problem sql_mode = only_full_group_by. Found by looking for the pattern must have a column corresponding to the aggregate function.
Referring specifically to:https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html
About sql_mode introduction, see the following description:
MySQLA reasonable set of sql_mode
sql_mode is easily overlooked variable, the default value is a null value, in this arrangement is to allow some illegal operations, such as allowing some invalid data is inserted. This value must be set in a production environment for strict mode, developers,testenvironmentaldatabaseIt must also be set so that the development and testing stage can be found problems
sql_mode common values are as follows:
ONLY_FULL_GROUP_BY:
For GROUP BY aggregate operations, if a column in the SELECT, does not appear in a GROUP BY, then the SQL is not legitimate, because the column is not in the GROUP BY clause
NO_AUTO_VALUE_ON_ZERO:
The value is inserted from the impact of the growth column. In the default setting, the insert 0 or NULL on behalf of a self-generated growth value. If you want to insert a value of 0, and that column is self-growth, this option comes in handy.
STRICT_TRANS_TABLES:
In this mode, if a value can not be inserted into a transaction table, interrupting the current operation, no limitation on the non-transactional table
NO_ZERO_IN_DATE:
In strict mode, the date and month of zero is not allowed
NO_ZERO_DATE:
This value is set, mysql database does not allow zero-insertion date, insert zero dates will throw an error instead of a warning.
ERROR_FOR_DIVISION_BY_ZERO:
INSERT or UPDATE in the process, if the data is zero, an error instead of a warning is generated. If this mode is not given, then return NULL when data MySQL zero
NO_AUTO_CREATE_USER:
GRANT prohibit users create a blank password
NO_ENGINE_SUBSTITUTION:
If you need a storage engine is disabled or not compiled, then throw an error. When this value is not set, the default storage engine replacement, and throws an exception
PIPES_AS_CONCAT:
The "||" operator not regarded as connection strings or operators, and thisOracleThe database is the same, and also blending functions similar string Concat
ANSI_QUOTES:
ANSI_QUOTES then enabled, can not be used to refer to a string double quotation marks, because it is interpreted as an identifier