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