sql server - Which query would be better for Paging? -
which query better paging query 1 or query 2
query 1:
select ceiling(convert(decimal,count(*))/@pagesize) totalpages table
query 2:
select (count(*) + @pagesize - 1)/@pagesize totalpages table
bases on sample i'll go query 2
but technically speaking both have same performance in sql server, try executing them , see execution plan.
Comments
Post a Comment