ORACLE 这语句的错问题,求指点,在线等、、着急ING

select to_char(hiredate,''MM) from (select deptno,MAX(sal) from emp group by
deptno having deptno = 10);
其中,hiredate为日期字段,sal为工资,deptno为部门号,求大神指点哪里出了错误,
在线等,急!!!!!!!!!!!

 select hd,max(sal) from
(
select to_char(hiredate,'yyyymm') hd,sal from emp where deptno=10 
) group by hd

MM放在引号中间。
你这个问题也不说你要查询什么也没有测试数据也不给出错误提示。这种问题让人怎么回答。

给出你的测试数据以及预期的查询,而不是用什么模糊的字眼来描述问题。

select
deptno as"部门号",max(sal) as"最高工资",to_char(hiredate,'mm') as "月份"
from
emp group by deptno,to_char(hiredate,'mm')
having
deptno = 10;