带连接的mysql group by子句

带连接的mysql group by子句,mysql,Mysql,数据库中有两个表 我提出了这个问题 SELECT orderdate,priceeach FROM orders AS T1 INNER JOIN orderdetails AS T2 ON T1.orderNumber = T2.orderNumber GROUP BY orderdate; 获取此错误 ERROR 1055 (42000): Expression #2 of SELECT list is not in GROUP BY clause and contains

数据库中有两个表

我提出了这个问题

SELECT  orderdate,priceeach 
FROM  orders AS T1 
INNER JOIN orderdetails AS T2 
ON T1.orderNumber = T2.orderNumber 
GROUP BY orderdate;
获取此错误

ERROR 1055 (42000): Expression #2 of SELECT list is not in GROUP BY clause and contains non aggregated column 'classicmodels.T2.priceEach' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
请帮我解决这个问题,并请解释哪个语句或子句按顺序首先执行,以及为什么我会出现这个错误


因为我用两个不同的数据库(虚拟数据库)尝试了相同的查询,结果成功了。

您到底在结果中寻找什么?您想找出每个订单日期的最低或最高价格吗?基本上,group by所做的是将相同的行分组,并将它们缩短到正确的位置?为什么不使用单列?也就是说,
orderby
好的,那么group做什么呢?groupby只想为您指定的orderdate列返回一行。问题是它不知道从组中选择哪一行,因为您需要某个集合,所以查询知道选择哪一行。此外,对于GroupBy中必须在SelectBy中使用的每一项内容,您在结果中到底要查找什么?您想找出每个订单日期的最低或最高价格吗?基本上,group by所做的是将相同的行分组,并将它们缩短到正确的位置?为什么不使用单列?也就是说,
orderby
好的,那么group做什么呢?groupby只想为您指定的orderdate列返回一行。问题是它不知道从组中选择哪一行,因为您需要某个集合,所以查询知道选择哪一行。此外,GroupBy中的每一项都必须在select中使用