该MDW_CUSTOMER_ACCOUNTS
表有CUSTOMER_ID
,ACCOUNT_ID
和INVOICE_ID
该MDW_INVOICE
表有INVOICE_ID
, INVOICE_TRANSACTIONID1
, INVOICE_TRANSACTIONID2
,INVOICE_TRANSACTIONID3
MDW_INVOICE_TRANSACTION
桌子INVOICE_TRANSACTIONID
有,COST
我正在尝试使用查询从三个表中打印ACCOUNT_ID
, COST1
, COST2
,COST3
SQL> SELECT a.account_id , to_number(i1.cost) , to_number(i2.cost) , to_number(i3.cost)
2 FROM mdw_customer_accounts a,
3 mdw_invoice b,
4 mdw_invoice_transaction c
5 LEFT JOIN mdw_invoice i1 ON b.INVOICE_TRANSACTIONID1 = i1.INVOICE_TRANSACTIONID
6 LEFT JOIN mdw_invoice i2 ON b.INVOICE_TRANSACTIONID2 = i2.INVOICE_TRANSACTIONID
7 LEFT JOIN mdw_invoice i3 ON b.INVOICE_TRANSACTIONID3 =i3.INVOICE_TRANSACTIONID
8 WHERE a.customer_id='CUS0031' and a.invoice_id=b.invoice_id and a.STATUS='ACTIVE';
我收到以下错误
LEFT JOIN mdw_invoice i1 ON b.INVOICE_TRANSACTIONID1 = i1.INVOICE_TRANSACTIONID * 第 5 行出现错误:ORA-00904:“I1”。“INVOICE_TRANSACTIONID”:标识符无效