SQL Language (MOSC)

MOSC Banner

oracle 12.2.0.1 BUG for group by

edited Sep 13, 2018 5:02AM in SQL Language (MOSC) 2 commentsAnswered

First,I create a table named test and insert 3 rows:
SQL> create table test(name varchar2(10),id number);
SQL> insert into test values('1201',1);
SQL> insert into test values('120101',2);
SQL> insert into test values('120103',3);
SQL> commit;
SQL> select * from test;

NAME                         ID
-------------------- ----------
1201                          1
120101                        2
120103                        3

Second, I run the following SQL and get a correct result set
SQL> select /*+ all_rows full(t1) */
  2         length(t1.name)
  3  from   test t1
  4  group  by length(t1.name);

LENGTH(T1.NAME)
---------------
              6
              4

and now, I add a primary key for table test
alter table test add constraint pk_test primary key (name)

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center