β

sql5.7报错

开心&努力 54 阅读

match error:Error 1055: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘appstore_wps_cn.app_stores.app_type’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by”

如何解决?


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';
SELECT @@sql_mode
SELECT app_id,app_type,MAX(app_ver)app_ver,sdk_ver,app_name,client_id,client_os,package_info,down_url FROM `app_stores`  WHERE `app_stores`.`deleted_at` IS NULL AND ((`app_type`='tools') AND (`client_os`='pc') AND (`sdk_ver`<='00002.00007')) GROUP BY app_id
作者:开心&努力
心路:人生的质量源自于精神的“法喜充满”
原文地址:sql5.7报错, 感谢原作者分享。