ORA-00918 column ambiguously defined, ora00918

Source: Internet
Author: User

ORA-00918 column ambiguously defined, ora00918
In 11.2.0.1, the same SQL statement can be executed normally:
Select -- coupon income
'Voer er' as summode,
A. billingdate,
A. rdate,
A. storeroomid,
A. accountscode,
G. accountsname,
I. RELATED, -- business content
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, -- receipt method name
Case when I. RELATED = 'hq _ billcheckout 'THEN h. statistic_class ELSE NULL END AS statistic_class, -- collection method category
Nvl (a. debit, 0)-nvl (a. credit, 0) as tradeMoney,
0 as StandDealTotalm,
0 as DiscDealTotal,
0 as OtheDealTotal
From HQ_accountingbooks
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;
Error in 11.2.0.4:
ORA-00918: column ambiguously defined
After comparison, all the corresponding table and table structures in the two databases are the same. Why can't I execute normally in 11.2.0.1 but not in 11.2.0.4?
The SQL statement contains the BILLSUBCASE column in two tables:
Select BILLSUBCASE from HQ_accountingbooks;
Select BILLSUBCASE from m_coupon_grant;
Therefore, a. BILLSUBCASE = 5201 is specified to solve the problem.
It seems that 11.2.0.4 has more strict SQL syntax requirements.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.