Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Does anyone have efficient SQL paging code?

$
0
0
I have the code below, but it seems to be a little slower than i would like, even though the SQL DETA did not find anything wrong with it. ThanksSELECT id, title, companyname, did,begindate,description,city,state,city + ', ' + state as Location, employmenttype, degree,PAYLOW,PAYHIGH,payper,(select count(*) from results) totalcountFROM (SELECT *, ROW_NUMBER() OVER(ORDER BY BeginDate desc) R1 FROM results) T WHERE R1 BETWEEN 0 AND 9 OPTION(Maxdop 8)End

Viewing all articles
Browse latest Browse all 3145

Trending Articles