actixweb-sqlx-jwt icon indicating copy to clipboard operation
actixweb-sqlx-jwt copied to clipboard

MySql's only_full_group_by and any_value

Open biluohc opened this issue 5 years ago • 1 comments

error: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'd.time' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

https://www.cnblogs.com/Wayou/p/mysql_group_by_issue.html

Modify sql_mode or use any_value:

SELECT gender, 
-       last_name
+       ANY_VALUE(last_name) 
FROM   employees 
GROUP  BY gender 

biluohc avatar Jun 19 '20 09:06 biluohc

https://cloud.tencent.com/developer/article/1348024

biluohc avatar Jun 20 '20 02:06 biluohc