home clear 64x64
en blue 200x116 de orange 200x116 info letter User
suche 36x36
Latest versionsfixlist
11.1.0.7 FixList
10.5.0.9 FixList
10.1.0.6 FixList
9.8.0.5 FixList
9.7.0.11 FixList
9.5.0.10 FixList
9.1.0.12 FixList
Have problems? - contact us.
Register for free anmeldung-x26
Contact form kontakt-x26

DB2 - Problem description

Problem IT05825 Status: Closed

WRONG RESULT FROM STATEMENT WITH TWO OR MORE OLAP FUNCTIONS WITH COMPATIBLE
PARTITION-BY CLAUSES WITH ONE EQUATING TO CONSTANTS

product:
DB2 FOR LUW / DB2FORLUW / A50 - DB2
Problem description:
This problem only occurs in a DPF or SMP parallelism enabled 
environment. 
 
You might encounter an incorrect result set for a SQL statement 
that contains two or more OLAP functions with compatible 
partition-by clauses wherein at least one OLAP function contains 
a partition-by clause where all columns equate to constant 
values. A column can equate to a constant value by specifying 
the constant values explicitly in the partition by clause or the 
columns in the partition by clause are referenced in equality 
predicates that equate to constants. 
 
The following example specifies the constant value explicitly 
SELECT ... SUM(X) OVER (PARTITION BY 1 ...) ... 
 
and the following example references the partition by column in 
an equality predicate 
SELECT ... SUM(X) OVER (PARTITION BY Y ...) ... WHERE Y = 1 ...
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* DPF or SMP parallelism enabled environments                  * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* See Error Description                                        * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to Version 10.5 FixPack 7.                           * 
****************************************************************
Local Fix:
You can rewrite your query to move the OLAP function with 
constant partition-by clause into a nested table expression. 
For example, if you have two compatible OLAP functions in a 
query as follows: 
 
SELECT SUM(X) OVER (PARTITION BY A), SUM(Y) OVER (PARTITION BY 
A,B) FROM T1 WHERE T1.A=1 
 
then you can rewrite it as a nested table expression to avoid 
the incorrect result: 
 
SELECT SUMX, SUM(Y) OVER (PARTITION BY A,B) FROM (SELECT A,B,Y, 
SUM(X) OVER (PARTITION BY A) SUMX FROM T1 WHERE A=1) AS TMP
Solution
Problem was first fixed in DB2 UDB Version 10.5 FixPack 7.
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
29.11.2014
20.01.2016
27.04.2016
Problem solved at the following versions (IBM BugInfos)
Problem solved according to the fixlist(s) of the following version(s)
10.5.0.7 FixList