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.