1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Ora00909 - invalid number of arguments

Discussion in 'SQL PL/SQL' started by AAP, Jan 18, 2017.

  1. AAP

    AAP Starter

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    10
    Location:
    houston
    Hi i am getting ORA00909 when i try to run my query with the following CASE WHEN staement :

    CASE WHEN AV4.ALLOC_GRP_NO IN (SELECT ALLOC_GRP_NO FROM QRMTIPS.QCTRL_ALLOC_GRP_PROFILE WHERE
    DISP_CD = 'WHDV' GROUP BY ALLOC_GRP_NO
    HAVING COUNT(DISTINCT(MTR_SPLIT_NO)) > 1) THEN SUM(AV4.GAS_VOL,0) ELSE
    NVL(av4.gas_vol, 0) END AS ALLOC_MM_GAS

    please help!
     
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,645
    Likes Received:
    372
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    CASE isn't intended to calculate sums, averages and the like. The error is because the group by and having are likely returning more than one row. What output does the select produce when run on its own?