One thing I forgot to mention above.
In my query, field called 'rnk' of MYDB.MYTB is the ranked column by columname values. It happens before the recursive query starts. Like below -
INSERT INTO MYDB.MYTB
SELECT columnname
,RANK () OVER (ORDER BY columnid) rnk
FROM MYDB2.MYTB2
;
↧