troubleshooting Question

Missing Right Parenthesis Oracle SQL

Avatar of leezac
leezac asked on
Microsoft SQL ServerOracle DatabaseSQL
13 Comments6 Solutions1187 ViewsLast Modified:
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/9999','MM/DD/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
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 6 Answers and 13 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 6 Answers and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros