DB2 - Problem description
Problem IT16918 | Status: Closed |
INCORRECT QUERY RESULTS WHEN USING OFFSET-CLAUSE AND/OR FETCH-CLAUSE | |
product: | |
DB2 FOR LUW / DB2FORLUW / A50 - DB2 | |
Problem description: | |
A query that specifies a fetch-clause and/or offset-clause may return wrong results if there is a predicate in the same subselect. For example: SELECT ID, NAME FROM TABLE1 WHERE <predicate> ORDER BY ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY In some circumstances <predicate> may be applied after the offset-clause and fetch-first-clause are processed, which results in fewer rows than expected. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 version 10.5 fix pack 9 * **************************************************************** | |
Local Fix: | |
Move the predicate into a nested subselect, e.g.: SELECT ID, NAME FROM (SELECT ID, NAME FROM TABLE1 WHERE <predicate>) ORDER BY ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY | |
Solution | |
First fixed in DB2 version 10.5 fix pack 9 | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 06.09.2016 27.09.2017 01.10.2018 |
Problem solved at the following versions (IBM BugInfos) | |
9.0. | |
Problem solved according to the fixlist(s) of the following version(s) |