select * from `bdetector` where id in (select id from `bdetector` group by obj_key having count(obj_key) > 1) > 1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'cloud_platform.bdetector.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by > 时间: 0.002s
MySQL 5.7.5 and above functions depend on the detection function. If the
ONLY_FULL_GROUP_BY SQL mode is enabled (by default), MySQL will reject select lists, HAVING conditions, or ORDER BY list queries that reference non-aggregate columns that are neither named in the GROUP BY clause, nor are they functionally dependent on them. (Before 5.7.5, MySQL did not detect functional dependencies, and
ONLY_FULL_GROUP_BY was not enabled by default.
step 1: execute the following sql statement
Step 2: Remove
ONLY_FULL_GROUP_BY and reset the value.
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';
Execute the following sql statement:
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));