|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Need Help Multiple-Row Subqueries
TABLE IFGLM_CHART_OF_ACCOUNTS
CHART_OF_ACCOUNT_ID NUMBER (15) NOT NULL, ACCOUNT_TITLE VARCHAR2 (200) NOT NULL, TABLE IFGLT_BALANCES BALANCE_ID NUMBER (15) NOT NULL, MONTHLY_BAL_ID NUMBER (15), CHART_OF_ACCOUNT_ID NUMBER (15) NOT NULL, TRAN_YY NUMBER (4) NOT NULL, TRAN_MM NUMBER (2) NOT NULL, DEBIT_AMT NUMBER (18,2) DEFAULT 0 NOT NULL, CREDIT_AMT NUMBER (18,2) DEFAULT 0 NOT NULL, TRAN_BAL NUMBER (18,2) DEFAULT 0 NOT NULL, In this query, it will display revenue accounts for the year 2004 for the month of April, with its current amount and balances. SELECT GLCOA.CHART_OF_ACCOUNT_ID COAID, GLCOA.ACCOUNT_TITLE TITLE, GLBAL.TRAN_YY, GLBAL.TRAN_MM, (GLBAL.CREDIT_AMT-GLBAL.DEBIT_AMT) CURRNT_MO, GLBAL.TRAN_BAL, FROM IFGLT_BALANCES GLBAL, IFGLM_CHART_OF_ACCOUNTS GLCOA WHERE GLBAL.CHART_OF_ACCOUNT_ID=GLCOA.CHART_OF_ACCOUNT_ID(+) AND GLBAL.CHART_OF_ACCOUNT_ID BETWEEN 533 AND 613 AND GLBAL.TRAN_YY=2004 AND GLBALA.TRAN_MM=4; COAID TITLE TRN_YY TRN_MM CURRNT_MO TRN_BAL 001, rev01, 2004, 04, 150, 250 002, rev02, 2004, 04, 75, 150 COAID TITLE 001, rev01 002, rev02 COAID TRN_YY TRN_MM CURRNT_MO TRN_BAL 001, 2004, 04, 150, 250 002, 2004, 04, 75, 150 001, 2003, 04, 200 002, 2003, 04, 250 multiple-row sub queries column(*TRANBAL) twice from IFGLT_BALANCES,with reference current and previous year(*TRAN_YY) with this outputs: current: GLBAL.CREDIT_AMT-GLBAL.DEBIT_AMT Parameter: tran_yy and tran_mm. COAID Misce current cumltive Prev inc/ Incme: 04,2004 04,2004 04,2003 (dec) Title 001, rev01, 150, 250, 200, 50 002, rev02, 75, 150, 250, (100) Total 225, 400, 450, (50) |
|
#2
|
|||
|
|||
|
what is the question?
|
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Need Help Multiple-Row Subqueries |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|