Search This Blog

Wednesday, February 16, 2011

Row Number On Each Row of a Query Result Set with out using ranking function

Select Rowno=(Select Count(*) From test Where Col1<=t1.Col1 And Col2 <=t1.Col2)Col1, Col2, Col3, Col4  From test t1 Order By Col1, Col2
Ranking functions are not avalable in SQL 2000 that time we can use this code

No comments:

Post a Comment