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/

相关文章:

  • 2022-01-25
  • 2021-07-13
  • 2021-08-19
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-01
  • 2021-09-16
  • 2021-09-03
  • 2021-10-27
相关资源
相似解决方案