IBM Support

IT31208: INCORRECT RESULT WHEN USING TWICE JOIN WITH THE SAME TABLE WITH GROUP BY

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • Queries with following characteristic may return incorrect
    results:
    - GROUP BY query over base tables
    - FROM references the same table more than once using aliases
    - multiple columns in GROUP BY clause referencing same table
    using different aliases
    - one of GB column is primary/unique key and one column comes
    from different alias of the same table
    - PK column is referenced in SELECT, while column from different
    alias is not referenced in SELECT
    
    Sample query (tab1.id is primary key):
    SELECT a.id FROM tab1 a, tab1 b WHERE a.c1 = b.c1 GROUP BY a.id,
    b.c2 HAVING COUNT(*) > 1
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * SQL USING TWICE JOIN WITH THE SAME TABLE WITH                *
    * GROUP BY                                                     *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * See Error Description                                        *
    ****************************************************************
    

Problem conclusion

  • See Error Description
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT31208

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    B10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    YesHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2019-12-09

  • Closed date

    2021-03-19

  • Last modified date

    2021-03-29

  • APAR is sysrouted FROM one or more of the following:

    IT31207

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

[{"Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.1"}]

Document Information

Modified date:
31 March 2021