using pagenumber in SQL
{ Posted on 10/22/2009 04:41:00 AM
by Silvercode
}
In SQL Server2005, we can use row_number which returns the sequential number of a row ,starting at 1 for the first row in each partition.
SELECT row_number() Over (order by profile_date desc)
AS PageNumber,profile_id
FROM profiles
Result:
PageNumber profile_id
1 1235
2 1200
3 1189
SELECT row_number() Over (order by profile_date desc)
AS PageNumber,profile_id
FROM profiles
Result:
PageNumber profile_id
1 1235
2 1200
3 1189
No Response to "using pagenumber in SQL"
Post a Comment