Click here to Skip to main content
15,883,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

ROW_NUMBER() OVER (ORDER BY LrnParentInvolvment.ParentInvolvmentID) AS SNo


Please explain how does it work like with an example query
Posted
Updated 31-Jan-12 20:00pm
v2

This could[^] help you out (especially the "Help with Query (ROW_NUMBER() OVER ())" section).
 
Share this answer
 
This will firstly order the results by LrnParentInvolvment.ParentInvolvmentID Then starts to assign an incremental row number to them starting from 1.

You may see sometimes PARTITION BY before order by, then it will : firstly group them by the columns specified in PARTITION BY then orders each group by ORDER BY columns then starts numbering each group separately.

Hope it helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900