Multiple Row_Number() Calls in a Single SQL Query?

Each ROW_NUMBER requires the rows to be sorted first. Since your two RNs have different ORDER BY conditions, the query must produce the result, then order it for first RNs (it may be orderred already by), produce the RN, then order it for second RN and produce the second RN result. There simply isn't any magic pixie dust that can materialize a row number value without counting where the row is in the required order.

I am not sure that it can parallelize this, because it needs to do nonpartitioned (wrt population vs square miles) scans. They'll conflict with each on disk, so it has to get everything into memory at least once, first and then it might be eligible for parallelizing, if it's big enough.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions