Saturday, May 9, 2009

Give Rownumber to rows in select statements.

This is the syntax to select rows with IndexNumber in Select Operator.

we can use built in ROW_NUMBER function to achive this.

Select ROW_NUMBER() over (order by ID) as IndexNo,* from EC_OrderDetail

thanks.

No comments:

Post a Comment

Comments posted on ASP.Net Ajax Tutorials Blog are moderated and will be approved only if they are on-topic and not abusive. Please email me or my team for tech-support or blogging related questions. Avoid including website URLs in your comments - Thanks Author