oracle 12.2.0.1 BUG for group by
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)