Incorrect ordering in CTE query
Summary The issue at hand is related to the incorrect ordering of rows in a query using a Common Table Expression (CTE) with ROW_NUMBER() function. The query returns the correct ordering when run standalone, but the ordering is incorrect when wrapped in a CTE. Root Cause The root cause of this issue is due to … Read more