繁体   English   中英

获取ORA-00918:列模糊定义:运行此SQL :(添加表时)

[英]Getting ORA-00918: column ambiguously defined: running this SQL:(When adding a table)

我收到错误ORA-00918: column ambiguously defined运行此SQL时ORA-00918: column ambiguously defined :(添加表ra_interface_lines_all

SELECT DISTINCT rcta.TRX_NUMBER
              , rcta.trx_date
              , rcta.PRINTING_OPTION
              , rcta.PRINTING_PENDING
              , rcta.CREATED_FROM
              , houf.NAME  Business_Unit
              , xep.NAME   Legal_Entity
              , rctta.NAME Transaction_Type
              , rcta . invoice_currency_code
              , aaa.gl_date
              , rtb.NAME   Payment_Name
              , hca.account_name
FROM   ra_customer_trx_all        rcta
     , hr_organization_units_f_tl houf
     , xle_entity_profiles        xep
     , ra_terms_tl                rtb
     , RA_CUST_TRX_TYPES_ALL      rctta
     , hz_cust_accounts           hca
     , AR_ADJUSTMENTS_ALL         aaa
     , ra_interface_lines_all
WHERE  trx_number           = 3021
   AND rcta.org_id          = houf.organization_id
   AND xep.legal_entity_id  = rcta.legal_entity_id
   AND rcta.SET_OF_BOOKS_ID = aaa.SET_OF_BOOKS_ID 

如果具有相同列名的多个表,并且在没有别名的语句中使用此列名,则会出现此错误。 因此解释器无法确定它应该使用哪个表。

要修复查询,请检查所有没有别名的列并为它们添加前缀。 (例如trx_number

ra_interface_lines_all表具有存在于其他表中的trx_number列,因此您必须将表名(或别名)引用到列。

在您的情况下,如果它是新表,您可以更改为:

 , ra_interface_lines_all
   WHERE  ra_interface_lines_all.trx_number           = 3021

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM