ORA-00918 column ambiguously defined

原创 2015年06月20日 23:00:02
11.2.0.1中同样的一个SQL能正常执行:
 select  -- 代金券收入
         'VOUCHER' AS SUMMODE,
          a.billingdate,
          a.rdate,
          a.storeroomid,
       a.accountscode,
       g.accountsname,
       I.RELATED,--业务内容
       CASE WHEN I.RELATED = 'HQ_billcheckout' THEN H.DICTIONARYCODE ELSE NULL END AS PAYMENTCODE,
       CASE WHEN I.RELATED = 'HQ_billcheckout' THEN H.DICTIONARYNAME ELSE NULL END AS PAYMENT,--收款方式名称
       CASE WHEN I.RELATED = 'HQ_billcheckout' THEN h.statistic_class ELSE NULL END AS statistic_class,  --收款方式分类
       nvl(a.debit,0)-nvl(a.credit,0) as tradeMoney,
       0 as StandDealTotalm,
       0 as DiscDealTotal,
       0 as OtheDealTotal
  from HQ_accountingbooks a
  inner join m_coupon_grant d on a.bid=nvl(d.bid,d.cgid)
  inner join HQ_accounts g on a.accountscode=g.accountscode
  LEFT JOIN (SELECT A1.* FROM HQ_DATADICTIONARY A1 WHERE A1.DICTIONARYTYPE=1) H ON g.ACCOUNTSCODE=H.ACCOUNTCODE
  inner join HQ_billcase_accounts i on d.billsubcase=i.billsubcase and a.accountscode=i.accountscode
where BILLSUBCASE = 5201;
在11.2.0.4中报错:
ORA-00918: column ambiguously defined
对比了下,两个数据库中所有对应的表表结构都一样,为什么在11.2.0.1中能正常执行,在11.2.0.4中执行不了?
发现这个SQL中有2个表中都有BILLSUBCASE这一列:
select BILLSUBCASE from HQ_accountingbooks;
select BILLSUBCASE from m_coupon_grant;
于是指定a.BILLSUBCASE = 5201;即解决。
看来11.2.0.4中对SQL的语法要求更严格。

[Hibernate]"column ambiguously defined"异常

使用hibernate的nativeSQL写了一个查询语句,但是后台报了SQL语法错误,具体报错如下: [2012-08-08 12:55:00] ERROR -> ORA-00918: colum...

ORA-12899: value too large for column

昨天,同事导数据,本来一直好用的文件,就一直在报错:ORA-12899: value too large for column,本来以为程序修改导致字段长度变了,就改了一张表的结构。结果可好,导下一张...

ORA-24347: Warning of a NULL column in an aggregate function解决方法

前段时间support印度客户升级系统(从AIX到Linux6.3上),其中碰到一个ORA-2437: Warning of a NULL column in an aggregate functio...

Oralce导入数据时提示ORA-12899错误value too large for column

 从生产导出数据到测试,出现如下错误 ORA-02374: conversion error loading table "SWTONLINE"."TBL_TRANS_LOG_HISTORY_...
  • lyb3290
  • lyb3290
  • 2016年12月20日 09:11
  • 2857

ORA-01779: cannot modify a column which maps to a non key-preserved table

http://ora-01779.ora-code.com/ ORA-01779: cannot modify a column which maps to a non...

SQL Error: 957, SQLState: 42000 & ORA-00957: duplicate column name

1. PositionLinkage config   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">    ...

oracel存储过程 创建错误:ORA-06550: line 2, column 2:PLS-00905

环境:oracle 10g 当你运行存储过程时,异常。报下面的错误时 ORA-06550: line 2, column 2 PLS-00905:xxxxxx无效 PL/SQL: Statemen...

ORA-01438处理方法 value larger than specified precision allowed for this column

http://ora-01438.ora-code.com/ ORA-01438: value larger than specified precision allowe...

Oracle导数时报错:ORA-12899: value too large for column

原文链接:http://blog.csdn.net/shuiqingtinglin/article/details/7095787实际场景用Oracle自身支持的sqlldr语句导数据的时候,本来一直...

OGG: NLS_LENGTH_SEMANTICS报错信息ora-12899 value too large for column

1         故障记录 报告人/单位 甲骨灰 报告日期 04月 故障发生时间   故障解决时间 ...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:ORA-00918 column ambiguously defined
举报原因:
原因补充:

(最多只允许输入30个字)