Hi everyone, I'm getting strange results from a query.
I have a table list partitioned by id, when I execute this :
select max(col1) from table where id=100;
it returns the value 'A1'. Then I execute the following (keep in mind that partName is the name of the partition for id=100):
select max(col1) from table (partName);
and it returns 'B1'
The correct value in partition partName is B1, if I
select id from table where col1='A1'
it returns the correct value (500).
Do you know of any bug on the MAX function using partitioned tables that could cause this?
Thanks!
I can't reproduce this or find any obviously related bugs:
create table t (
c1 int,
c2 int
) partition by list ( c1 ) (
partition p1 values ( 1 ),
partition p2 values ( 2 ),
partition p3 values ( 3 ),
partition p4 values ( 4 )
);
insert into t
with rws as (
select mod ( level, 4 ) + 1, level x
from dual
connect by level <= 10
)
select * from rws;
select max ( c2 ) from t
where c1 = 1;
MAX(C2)
8
select max ( c2 )
from t partition ( p1 );
MAX(C2)
8
If you want us to look into this further, we'll need a complete test-case:
- create table
- insert into
- selects