sqlteradataora-00936

ORA-00936: Missing Expression Teradata


I'm having trouble identifying where the issue is in my code. Any help would be greatly appreciated. Using Teradata and it's coming back with error "SELECT Failed. ORA-00936: missing expression".

SELECT

,CR.CLAIMNUMBER 
,CR.LINENUMBER  
,SUBSTR(CLM.SUBMITTERCLAIMNUMBER,3,11) AS CLM_NBR
,CR.SEQNUMBER   
,MAX(CR.SEQNUMBER) AS MAX_SEQ 
,CR.VOLUME  
,CR.VOLUMETYPE  
,CR.RATE    
,CR.RATETYPE    
,CR.ALLOWED     
FROM PRICER.CLMREPRICINGDETAIL CR   
INNER JOIN PRICER.CLMCLAIMS CLM ON  CLM.CLAIMNUMBER = CR.CLAIMNUMBER    
INNER JOIN PRICER.CLMCLAIMITEMS CLMP ON CLM.CLAIMNUMBER = CLMP.CLAIMNUMBER AND CLM.OWNERID = CLMP.OWNERID   
INNER JOIN PRICER.CLMINSURED CLMI ON CLM.CLAIMNUMBER = CLMI.CLAIMNUMBER AND CLM.OWNERID = CLMI.OWNERID  

WHERE TRADEPARTNERID IN ('NationalNonHouse','NationalHouse')

AND SUBSTR(CLM.SUBMITTERCLAIMNUMBER,3,11) IN ('17304CD2083','17297CA4107')  
group by 1,2,3,4,5,6,7,8,9,10   
having CR.SEQNUMBER =  MAX_SEQ 
;

Solution

  • I would remove the comma after SELECT:

    SELECT CR.CLAIMNUMBER 
    , CR.LINENUMBER  
    , SUBSTR(CLM.SUBMITTERCLAIMNUMBER,3,11) AS CLM_NBR
    , CR.SEQNUMBER   
    , MAX(CR.SEQNUMBER) AS MAX_SEQ 
    , CR.VOLUME  
    , CR.VOLUMETYPE  
    , CR.RATE    
    , CR.RATETYPE    
    , CR.ALLOWED     
    FROM PRICER.CLMREPRICINGDETAIL CR   
    INNER JOIN PRICER.CLMCLAIMS CLM ON  CLM.CLAIMNUMBER = CR.CLAIMNUMBER    
    INNER JOIN PRICER.CLMCLAIMITEMS CLMP ON CLM.CLAIMNUMBER = CLMP.CLAIMNUMBER AND CLM.OWNERID = CLMP.OWNERID   
    INNER JOIN PRICER.CLMINSURED CLMI ON CLM.CLAIMNUMBER = CLMI.CLAIMNUMBER AND CLM.OWNERID = CLMI.OWNERID  
    
    WHERE TRADEPARTNERID IN ('NationalNonHouse','NationalHouse')
    AND SUBSTR(CLM.SUBMITTERCLAIMNUMBER,3,11) IN ('17304CD2083','17297CA4107')  
    group by 1,2,3,4,5,6,7,8,9,10   
    having CR.SEQNUMBER =  MAX_SEQ;