ROW_NUMBER() OVER(PARTITION BY XXX ORDER BY XXX)
    **

    1. SELECT STP.FLOW_INST_ID,
    2. BUU.USER_NAME,
    3. ORGG.NAME_,
    4. ROW_NUMBER() OVER(PARTITION BY STP.FLOW_INST_ID ORDER BY STP.FINISH_TIME) RN,
    5. -- STP.FLOW_INST_ID,每个 flow_inst_id 不相等的,都是1,两个相同的flow_inst_id ,为12,三个相同的就是1 2 3
    6. ROW_NUMBER() OVER(PARTITION BY BUU.USER_NAME ORDER BY STP.FINISH_TIME) tt
    7. FROM TABLE1 STP -- 步骤实例历史记录表

    oracle ROW_NUMBER()函数 - 图1