leezac
asked on
Missing Right Parenthesis Oracle SQL
I am getting an error "Missing Right Parenthesis" on this line. ) C ON A.PLAN_ID=C.PLAN_ID AND A.SSN_ID=C.SSN_ID
I can't figure why - it looks like all of them are there.
__________________________ __________ __________ __________ __________ __________ __________ ______
SELECT PLAN_N, PLAN_SHRT_NM, DVSN_NM, C.Plan_ID,
SUM(Case when BAL>0 THEN Balance Else 0 end) as "Assets"
FROM(
SELECT A.PLAN_ID, PLAN_N, PLAN_SHRT_NM, SUM(END_ASET_BAL_A)as BAL
FROM dbo.V_BAL_MO A
LEFT JOIN(
SELECT
(Sum(case when STAT_C IN ('A') AND PCNT > 1 and DEF_DOL = 0 then 1 else 0 end)
+Sum(case when STAT_C IN('A') AND PCNT < 1 and DEF_DOL > 0
then 1 else 0 end))/Sum(case when STAT_C IN('A')
then 1 else 0 end) as RATE
,NVL(ROUND(AVG(CASE when STAT_C IN ('A')
AND PCNT > 1 THEN PCNT end),2),0) as DRATE
FROM(
SELECT PlanID, NVL(DEF_A,0) as DEF_DOL, NVL(DEF_P,0) as PCNT, SSN_ID, STAT_C
FROM dbo.V_PART
WHERE row_exp_d=TO_DATE('01/01/9 999','MM/D D/YYYY')
AND PLAN_ID IN ('207')
) C ON A.PLAN_ID=C.PLAN_ID AND A.SSN_ID=C.SSN_ID
) GROUP BY PLAN_N, PLAN_SHRT_NM, DVSN_NM
I can't figure why - it looks like all of them are there.
__________________________
SELECT PLAN_N, PLAN_SHRT_NM, DVSN_NM, C.Plan_ID,
SUM(Case when BAL>0 THEN Balance Else 0 end) as "Assets"
FROM(
SELECT A.PLAN_ID, PLAN_N, PLAN_SHRT_NM, SUM(END_ASET_BAL_A)as BAL
FROM dbo.V_BAL_MO A
LEFT JOIN(
SELECT
(Sum(case when STAT_C IN ('A') AND PCNT > 1 and DEF_DOL = 0 then 1 else 0 end)
+Sum(case when STAT_C IN('A') AND PCNT < 1 and DEF_DOL > 0
then 1 else 0 end))/Sum(case when STAT_C IN('A')
then 1 else 0 end) as RATE
,NVL(ROUND(AVG(CASE when STAT_C IN ('A')
AND PCNT > 1 THEN PCNT end),2),0) as DRATE
FROM(
SELECT PlanID, NVL(DEF_A,0) as DEF_DOL, NVL(DEF_P,0) as PCNT, SSN_ID, STAT_C
FROM dbo.V_PART
WHERE row_exp_d=TO_DATE('01/01/9
AND PLAN_ID IN ('207')
) C ON A.PLAN_ID=C.PLAN_ID AND A.SSN_ID=C.SSN_ID
) GROUP BY PLAN_N, PLAN_SHRT_NM, DVSN_NM
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I did not write the code and may post the complete code to get help. I am not a SQL guru and can use all the help I can get. The code can probably be rewritten to be more efficient.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I appreciate comments.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Oracle SQL
>>Oracle SQL
I do not know what this is trying to tell me.
I do not know what this is trying to tell me.
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for leezac's comment #a40448694
Assisted answer: 84 points for Jim Horn's comment #a40443436
Assisted answer: 84 points for Racimo's comment #a40443604
Assisted answer: 83 points for slightwv's comment #a40443632
Assisted answer: 83 points for markgeer's comment #a40443703
Assisted answer: 83 points for slightwv's comment #a40443858
Assisted answer: 83 points for slightwv's comment #a40448635
for the following reason:
Thank you!
Accepted answer: 0 points for leezac's comment #a40448694
Assisted answer: 84 points for Jim Horn's comment #a40443436
Assisted answer: 84 points for Racimo's comment #a40443604
Assisted answer: 83 points for slightwv's comment #a40443632
Assisted answer: 83 points for markgeer's comment #a40443703
Assisted answer: 83 points for slightwv's comment #a40443858
Assisted answer: 83 points for slightwv's comment #a40448635
for the following reason:
Thank you!
ASKER
Thank you!
ASKER