我有一个很大的SQL查询,这给了我一些麻烦。这是查询:
-- Invoice-to
SELECT hzp.party_number customer_number
, hzp.party_name customer_name
, hzp.party_type
, hzp.address1
, hzp.address2
, hzp.address3
, hzp.address4
, hzp.city
, hzp.postal_code
, hzp.state
, hzp.country
, hzp.status
, hzps.party_site_number
, hzac.account_number
, hzac.account_name
, site.site_use_code
, rct.remit_to_address_id
FROM hz_parties hzp
LEFT OUTER JOIN hz_party_sites hzps ON hzps.party_id = hzp.party_id
LEFT OUTER JOIN hz_cust_accounts hzac ON hzac.party_id = hzp.party_id
LEFT OUTER JOIN hz_locations hzl ON hzl.location_id = hzps.location_id
LEFT OUTER JOIN hz_cust_acct_sites_all acct ON acct.party_site_id = hzps.party_site_id
/*LEFT OUTER */ --AND acct.cust_account_id = hzac.cust_account_id
LEFT OUTER JOIN hz_cust_site_uses_all site ON site.cust_acct_site_id = acct.cust_acct_site_id
AND site.site_use_code = 'BILL_TO' /* site was hcsu? */
LEFT OUTER JOIN ra_customer_trx_all rct ON rct.remit_to_address_id = acct.remit_to_address_id
;
--checked , had an erro
我收到了这个错误:
Error at Command Line:27 Column:70
Error report:
SQL Error: ORA-00904: "ACCT"."REMIT_TO_ADDRESS_ID": invalid identifier
00904. 00000 - "%s: invalid identifier"
我查找了无效的ID,但它并没有帮助我理解它的逻辑。任何提示赞赏