Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Query works with Oracle 10g but not with 11g?

DECLARE
  trn  VARCHAR2(2) := 'DD';
  cur  SYS_REFCURSOR;
BEGIN
  OPEN cur FOR
    SELECT
      TRUNC(some_date, trn),
      NULL AS dummy_2,
      COUNT( DISTINCT dummy_1 )
    FROM
      (SELECT SYSDATE AS some_date, ROWNUM AS dummy_1 FROM dual)
    GROUP BY
      TRUNC(some_date, trn);
END;

This works with Oracle 10, but with Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production it results in:

ORA-00979: not a GROUP BY expression
ORA-06512: at line 5


Can anyone reproduce/explain this? Thanks!

like image 943
Peter Lang Avatar asked Dec 06 '10 08:12

Peter Lang


People also ask

What is the difference between Oracle 10g and 11g?

Difference between Oracle 10g and Oracle 11g Compared with Oracle 10g, the later version of Oracle 11g offers more simplified, automated, and advanced memory management tools and features. The latter is equipped with better abilities to diagnose faults via inbuilt infrastructure.

Can we install Oracle 10g and 11g same machine?

You can install 11G and 10G on same machine with different oracle home.

Is Oracle 11g obsolete?

From the 31st December 2020, Oracle are stopping extended support on 11g database. This could have a huge impact on your business if you're running 11g, as you'll no longer be supported.

Is Oracle 11g SQL?

Oracle Database 11g makes PL/SQL coding yet more efficient for programmers. In this installment, you will see some examples that offer an introductory glimpse into this new functionality.


1 Answers

if you have access to support, it looks like Bug 9478304: LOOP FAILING WITH ORA-00979: NOT A GROUP BY EXPRESSION. This seems to affect 11.2.0.1 only.

like image 77
Vincent Malgrat Avatar answered Oct 13 '22 05:10

Vincent Malgrat