DB2 - Problembeschreibung
Problem IC78930 | Status: Geschlossen |
UNABLE TO SORT WHEN USING OLAP FUNCTION AND "ORDER BY" | |
Produkt: | |
DB2 FOR LUW / DB2FORLUW / 910 - DB2 | |
Problembeschreibung: | |
When using the "ORDER BY DESC" or "ORDER BY ASC" clause within an SQL statement containing an OLAP function, the order might not be enforced giving unordered results Per example: db2 "select row_number() over() as num, tabname from syscat.tables order by num desc" gives an unordered result although DESC is specified. | |
Problem-Zusammenfassung: | |
**************************************************************** * USERS AFFECTED: * * Users of OLAP functions in SQL statements * **************************************************************** * PROBLEM DESCRIPTION: * * When using the "ORDER BY DESC" or "ORDER BY ASC" clause * * within * * an SQL statement * * containing an OLAP function, the order might not be enforced * * giving unordered results * * * * For example: * * db2 "select row_number() over() as num, tabname from * * syscat.tables order by num desc" * * gives an unordered result although DESC is specified. * **************************************************************** * RECOMMENDATION: * * Please upgrade to DB2 LUW V9.1 FP11 * **************************************************************** | |
Local-Fix: | |
verfügbare FixPacks: | |
DB2 Version 9.1 Fix Pack 11 for Linux, UNIX and Windows | |
Lösung | |
Problem was fixed in DB2 LUW V9.1 FP11 | |
Workaround | |
1)"order by 1" db2 "select row_number() over() as num, tabname from syscat.tables order by 1 desc" . 2)the OLAP query can be moved into a nested subquery db2 "select num, tabname from ( select row_number() over() as num, tabname from syscat.tables ) T order by num desc" | |
Bug-Verfolgung | |
Vorgänger : APAR is sysrouted TO one or more of the following: IC78931 Nachfolger : | |
Weitere Daten | |
Datum - Problem gemeldet : Datum - Problem geschlossen : Datum - der letzten Änderung: | 27.09.2011 23.12.2011 23.12.2011 |
Problem behoben ab folgender Versionen (IBM BugInfos) | |
9.1.FP11 | |
Problem behoben lt. FixList in der Version | |
9.1.0.11 |