select max(sal),deptno,ename from emp group by deptno order by max(sal);哪里错了?

2024-12-26 07:54:17
推荐回答(1个)
回答1:

select max(sal),deptno,ename from emp group by deptno,ename order by max(sal);
含有group by 的语句,select 的字段除了group by中出现的,其余必须是聚合函数,类似max这些确定唯一一条的