Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Can someone simplify this query
Hi,
SELECT *
FROM (SELECT officecode off1, acno_code acc1,
SUM (current_purchase_amount) sum1 FROM bweb_assetpurchasetxndetails GROUP BY officecode, acno_code) tab1, (SELECT officecode off2, account_code acc2, SUM (org_budget_amt) sum3, SUM (rev_budget_amt) sum4 FROM bweb_budgetmaster GROUP BY account_code, officecode) tab2WHERE tab1.off1 (+)= tab2.off2
can someone help me simplify this query. preferably with a single select clause? the reason i'm using this kind of query is that if i use a single group by clause, it causes the sum of the budget amount and the rev budget amount to be calculated incorrectly. it is displayed as many times as there are rows in the asset purchase table for a given combination of office code and account code.
I'm using Crystal Reports 10, and I want to use this query. can someone help me?
thanks in advance,
kirtan
Received on Tue Feb 08 2005 - 23:12:28 CST
![]() |
![]() |