Description
Given following tables :
create table test ( pk1 varchar not null , pk2 varchar not null, pk3 varchar not null, v1 varchar, v2 varchar, CONSTRAINT TEST_PK PRIMARY KEY ( pk1,pk2,pk3))
The result of the following sql may be incorrect:
select distinct pk1,max(v1) from test group by pk1,pk2,pk3 order by pk1
The problem is the order by is complied out because it is the prefix of the group by, but for distinct, DistinctAggregatingResultIterator using HashSet to rearrange the aggregated tuples.
Attachments
Attachments
Issue Links
- links to