日期:2014-05-17  浏览次数:20996 次

使用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 的时候 还没有生效呢