Re: ORA-00979

From: joel garry <joel-garry_at_home.com>
Date: Wed, 24 Oct 2012 12:42:27 -0700 (PDT)
Message-ID: <3ea184f9-dcb4-4a25-97bb-b79fce77eaae_at_mq1g2000pbb.googlegroups.com>



On Oct 24, 12:23 pm, Tim Slattery <Slatter..._at_bls.gov> wrote:
> I'm getting this error message:
>
> ORA-00979: not a GROUP BY expression ORA-06512: at
> "IPP.IPP_GETCURRENTPRICE", line 17 ORA-06512: at line 1
>
> Which points to this statement in a function:
>
>      OPEN cv_1 FOR
>          SELECT item_code,
>                 index_date,
>                 price,
>                 currency_code,
>                 price_basis,
>                 not_traded,
>                 price_estimated,
>                 no_change,
>                 is_valid
>            FROM ipp_price
>           WHERE item_code = v_code
>            GROUP BY item_code
>
>             HAVING index_date = MAX(index_date);
>
> The value being passed in for v_code is correct. What is it objecting
> to?
>
> --
> Tim Slattery
> Slatter..._at_bls.gov

Perhaps the index_date not being in a group by?

Maybe you need a subquery that has the select for the max date in it.

jg

--
_at_home.com is bogus.
EXT4 Data Corruption Bug Hits Stable Linux Kernels
http://www.phoronix.com/scan.php?page=news_item&px=MTIxNDQ
Received on Wed Oct 24 2012 - 21:42:27 CEST

Original text of this message