Query returns two rows instead of one
CREATE TABLE test (
col1 NUMBER);
insert into test(col1) values (1);
CREATE TABLE test2 (
col1 varchar2(10),
col2 varchar2(100)
);
insert into test2(col1, col2) values('1', 'Test 1');
insert into test2(col1, col2) values('01', 'Test 01');
select a.col1, (select max(b.col2) from test2 b where a.col1 = b.col1) from test a;
The select in the end returns two rows instead of one which is strange.
This appears in Oracle 12c and 18c but not in 11g.
Is this a bug in Oracle 12c and 18c?