Netezza Performance Server

Netezza Performance Server

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
Expand all | Collapse all

Translating Oracle KEEP DENSE RANK Function to Netezza.

  • 1.  Translating Oracle KEEP DENSE RANK Function to Netezza.

    Posted Tue June 14, 2022 02:26 PM
    Edited by System Admin Fri January 20, 2023 04:39 PM
    I am having the hardest time converting the following Oracle code to Netezza:

    -- most recent action
    MAX(fa.action)
    KEEP ( DENSE_RANK LAST ORDER BY fm.open_date )
    OVER ( PARTITION BY ff.id )
    as max_action,

    Any assistance appreciated. 

    'open_date' can contain nulls.

    ------------------------------
    David Briars
    ------------------------------
    #NetezzaPerformanceServer


  • 2.  RE: Translating Oracle KEEP DENSE RANK Function to Netezza.

    Posted Wed June 29, 2022 03:30 PM
    Looks like the Netezza analytical function LAST_VALUE is what I needed to use...

    LAST_VALUE(fa.action)
    OVER (PARTITION BY ff.id
    ORDER BY fm.open_date
    ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
    as max_action

    ------------------------------
    David Briars
    ------------------------------