Row_Number()
を使用できます クエリと注文 SubscribeId
降順および row[0]["RowNumber"]
合計は次のようになります:
Select
* ,
ROW_NUMBER() OVER ( ORDER BY SubscribeId DESC) as RowNumber
From billing.BillMaster As BM
Where
( Bm.SubscribeId = '12345674' )
Order by SubscribeId
OFFSET @PageNumber * @RowCount ROWS
FETCH NEXT @RowCount ROWS ONLY;