• bayudw, i think the row_number() solution will be faster than the query you currently use. check it out and share the execution time/plan.

    - arjun

    https://sqlroadie.com/