SELECT A.ORDER_ID,A.OP_DATE,row_number() OVER(PARTITION BY a.order_id ORDER BY A.op_date DESC) RN FROM TV_BU_BILL_RECORD A