转自:http://www.javabrother.net/viewthread.php?tid=3447
java.sql.SQLException: ORA-00918: 未明确定义列ORA-00918, 异常,
Oraclejava.sql.SQLException: ORA-00918: 未明确定义列
大概就是报的这个异常,意思就是有两个或者多个相同的列,Oracle它不知道怎么办,所以就报这个异常,希望你去解决,^_^
select b.id,b.customname, datadescription as cusType,b.customcode, datadescription as cusState from cstcustom b left join sysdictionary c on b.customstate = c.dataid and c.datatypecode = 'CustomState' left join sysdictionary d on b.customtypeid = d.dataid and d.datatypecode = 'CustomType' where b.customstate != 2
改过后:
select b.id,b.customname, d.datadescription as cusType,b.customcode, c.datadescription as cusState from cstcustom b left join sysdictionary c on b.customstate = c.dataidand c.datatypecode = 'CustomState' left join sysdictionary d on b.customtypeid = d.dataid and d.datatypecode = 'CustomType' where b.customstate != 2
就OK了!
本文讨论了在使用Oracle SQL时遇到的ORA-00918异常,该异常通常由重复列名引起。通过示例代码演示了如何修改查询语句以解决此问题,并确保数据库操作正确执行。
3469

被折叠的 条评论
为什么被折叠?



