java.sql.SQLException: ORA-00918: column ambiguously defined

时间:2014-04-11 15:04:20   收藏:0   阅读:498

oracle:

select * from t_apply a, (select distinct ta.misdn from t_userarea ta where ta.mobileshop_id in (
    select t.mobileshop_id from t_userarea t where t.misdn=#{omisdn})) b where a.misdn=b.misdn
and a.status=3
and a.id not in (
    select td.applyId from t_delapply td where td.misdn=#{omisdn}
)


在plsql中可以运行, 查询出数据.

但是在eclipse项目中运行报错:java.sql.SQLException: ORA-00918: column ambiguously defined.

多表操作时,语句中的列名,不明确.

修改成:

select a.* from t_apply a, (select distinct ta.misdn from t_userarea ta where ta.mobileshop_id in (
    select t.mobileshop_id from t_userarea t where t.misdn=#{omisdn})) b where a.misdn=b.misdn
and a.status=3
and a.id not in (
    select td.applyId from t_delapply td where td.misdn=#{omisdn}
)

就可以了.





本文出自 “点点滴滴” 博客,请务必保留此出处http://alittlebit.blog.51cto.com/1994086/1393461

java.sql.SQLException: ORA-00918: column ambiguously defined,布布扣,bubuko.com

原文:http://alittlebit.blog.51cto.com/1994086/1393461

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!