以下是我的查询:
select MAX(o.amount)as Biggest_Purchase , c.cust_fname, c.cust_lname
from orders o, customer c
where o.cust_num = c.cust_num
group by c.cust_fname, c.cust_lname
order by o.amount desc;
为什么我会收到以下错误?:
消息 8127,级别 16,状态 1,第 5 行列“orders.amount”在 ORDER BY 子句中无效,因为它不包含在聚合函数或 GROUP BY 子句中。