It's been a while for me since the last time I did Oracle SQL, hope someone can tell me why I get a 933 on:
SELECT TRIM(A.ACCOUNTNUMBER) AS INDBDebnmbr
, TRIM(A.VOUCHER) AS INinvoicenmbr
, A.DATE_ AS INinvoiceDate
, A.DUEDATE AS INinvoiceDueDate
, A.TXT AS INDescription
, A.EXCHANGECODE AS INCurrencyCode
, subq.AMOUNTMST AS INOriginalamount
, subq.SETTLEAMOUNTMST AS INpaidAmount
, subq.OPENAMOUNT AS INOpenAmount
FROM (
SELECT DEBTRANS.VOUCHER AS VOUCHER, SUM(DEBTRANS.AMOUNTMST) AS AMOUNTMST
, SUM(DEBTRANS.SETTLEAMOUNTMST) AS SETTLEAMOUNTMST
, SUM(DEBTRANS.AMOUNTMST - DEBTRANS.SETTLEAMOUNTMST) AS OPENAMOUNT
FROM XAL_SUPERVISOR.DEBTRANS DEBTRANS
WHERE DEBTRANS.OPEN = 1 AND
DEBTRANS.TRANSTYPE <> 9 AND
(DEBTRANS.AMOUNTMST - DEBTRANS.SETTLEAMOUNTMST) <> 0 AND
DEBTRANS.DATASET = 'FIK'
GROUP BY DEBTRANS.VOUCHER) subq INNER JOIN DEBTRANS A ON A.VOUCHER = subq.VOUCHER
In SQL Plus Thanks in advance,
Michael
Your comment about using 8i explains it. The ANSI '92 Join syntax was not implemented in Oracle until 9i.
You will need to modify your query:
SELECT TRIM(A.ACCOUNTNUMBER) AS INDBDebnmbr
, TRIM(A.VOUCHER) AS INinvoicenmbr
, A.DATE_ AS INinvoiceDate
, A.DUEDATE AS INinvoiceDueDate
, A.TXT AS INDescription
, A.EXCHANGECODE AS INCurrencyCode
, subq.AMOUNTMST AS INOriginalamount
, subq.SETTLEAMOUNTMST AS INpaidAmount
, subq.OPENAMOUNT AS INOpenAmount
FROM (
SELECT DEBTRANS.VOUCHER AS VOUCHER, SUM(DEBTRANS.AMOUNTMST) AS AMOUNTMST
, SUM(DEBTRANS.SETTLEAMOUNTMST) AS SETTLEAMOUNTMST
, SUM(DEBTRANS.AMOUNTMST - DEBTRANS.SETTLEAMOUNTMST) AS OPENAMOUNT
FROM XAL_SUPERVISOR.DEBTRANS DEBTRANS
WHERE DEBTRANS.OPEN = 1 AND
DEBTRANS.TRANSTYPE <> 9 AND
(DEBTRANS.AMOUNTMST - DEBTRANS.SETTLEAMOUNTMST) <> 0 AND
DEBTRANS.DATASET = 'FIK'
GROUP BY DEBTRANS.VOUCHER) subq,
DEBTRANS A
WHERE A.VOUCHER = subq.VOUCHER;