• + 0 comments

    If we run the inner subquery, then it would return following result set Subquery Output

    Since we want all the peoples for specific row_number() to appear in the same row, we are using group by. And, when using group by, we can either select the columns in the group by list, or use aggregate function. So, in my case I used MIN, but in this case doing, MAX would have given the same result.