我在这个请求上收到了 MYSQL 5.7 的错误。如何解决此错误?
#1055 - SELECT 列表的表达式 #3 不在 GROUP BY 子句中,并且包含非聚合列“test.c.customers_group_id”,它在功能上不依赖于 GROUP BY 子句中的列;这与 sql_mode=only_full_group_by 不兼容
select SQL_CALC_FOUND_ROWS c.customers_firstname,
c.customers_lastname,
c.customers_group_id,
sum(op.products_quantity * op.final_price) as ordersum
from customers c,
orders_products op,
orders o
where c.customers_id = o.customers_id
and o.orders_id = op.orders_id
group by c.customers_firstname,
c.customers_lastname
order by ordersum DESC