user.table.column, table.column 或列说明无效

 

Oracle统计采用别名出错(user.table.column, table.column 或列说明无效

 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

蕃薯耀 2015年12月29日 15:09:00 星期二

http://fanshuyao.iteye.com/

 

一、错误

java.sql.SQLException: ORA-01747: user.table.column, table.column 或列说明无效

 

 

使用的sql如下

select count(u.*) from T_USER u 
    inner join T_ORG_USER_R r on r.USER_ID = u.USER_ID and r.ENABLE_FLAG = 'Y' 
    where u.ENABLE_FLAG = 'Y' and r.ORG_ID = 23959;

 

二、错误原因

在关联查询中,Oracle不能使用count(u.*)这样的别名,不过在SQL中是可以的。

 

三、解决

 直接使用 count(*)

 

 

 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

蕃薯耀 2015年12月29日 15:09:00 星期二

http://fanshuyao.iteye.com/

posted @ 2015-12-29 15:43  蕃薯耀  阅读(1150)  评论(0编辑  收藏  举报