Thursday 27 July 2017

Sql server paging

// SQL server

Declare @PageNo int=5,@pageSize int=5

select top (@pageSize) * from(select ROW_NUMBER() OVER(ORDER BY hhguid ASC) as line, * from tblhh where createdby=94)mm

where line > (@PageNo - 1) * @pageSize

No comments:

Post a Comment

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...