应用to_char函数别名后,使用group by,报错“标识符无效”

使用to_char函数别名后,使用group by,报错“标识符无效”select to_char(sysdate,yyyy) xxxfrom dual dgro

使用to_char函数别名后,使用group by,报错“标识符无效”
select to_char(sysdate,'yyyy') xxx
from dual d
group by xxx

用to_char(sysdate,'yyyy')作为group by可以,但是为什么别名后不行呢?求原理???
[解决办法]
select * from 
(select to_char(sysdate,'yyyy') xxx
from dual d)
group by xxx

你的别名在group by 的时候 还没有生效呢