报错语句
Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘age’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
select列表中的第三列不存在于group by字句中,并且包含非聚合列’age’, 'age’并不依赖于group by字句中的列。
它和sql_mode=only_full_group_by不兼容。
原因解析
sql语句如下
select * from user where age>10 group by name
这条语句在<mysql5.7的版本中是允许的,会返回分组中的第一条数据。但在mysql5.7+中只允许查询group by
中的列以及使用聚合函数。
英文解析
-
clause n. UK /klɔːz/ US /klɑːz/
释义:
a particular part of a written legal document, for example a law passed by Parliament or a contract (= an agreement) 条款
在计算机中的意思是从句
例句:
Clause 4 of the constitution is thought to be the most important section
-
aggregate n.UK /ˈæɡ.rɪ.ɡət/ US /ˈæɡ.rə.ɡət/ v or adj
释义:
something formed by adding together severa amounts or things 集合体
例句:
They purchased an aggregate of 3,000 shares in the company
派生词
nonaggregated=non(否定前缀)+aggregated(adj.聚合的)
-
compatible adj UK /kəmˈpæt.ə.bəl/ US /kəmˈpæt̬.ə.bəl/
释义:
able to exist, live, or work successfully with something or someone else 共处,兼容
例句:
This software may not be compatible with older operating systems.
派生词:
incompatible=in(否定前缀)+compatible