I initially thought of using resrved word "VALUE" might be giving problem.
It seems to be that writing a partition name in the FROM clause gives wrong result set.
I just commented out partition. It worked correctly.
Another lesson learned today.
TamilPHP Code:SQL> get p1
1 SELECT
2 myvalue, subpart_list_key , COUNT(*)
3 FROM test_range_list_part ---PARTITION (p1)
4 WHERE
5 (
6 ( subpart_list_key =2 and myvalue = 1)
7 OR
8 ( subpart_list_key = 1 )
9 )
10 AND myvalue = 1
11* GROUP BY myvalue, subpart_list_key
12 /
MYVALUE SUBPART_LIST_KEY COUNT(*)
---------- ---------------- ----------
1 1 1
1 2 1
SQL> get p2
1 SELECT
2 myvalue, subpart_list_key , COUNT(*)
3 FROM test_range_list_part --PARTITION (p1)
4 WHERE
5 (
6 ( subpart_list_key =2 )
7 OR
8 ( subpart_list_key = 1 )
9 )
10 AND myvalue = 1
11* GROUP BY myvalue, subpart_list_key
12 /
MYVALUE SUBPART_LIST_KEY COUNT(*)
---------- ---------------- ----------
1 1 1
1 2 1
SQL> spool off




Reply With Quote