概述 /// <summary> /// 构造
分页sql /// </summary> /// <param name="sql">sql分页前</param> /// <param name="orderColumn">排序列</param> /// <param name="rowIndex">开始位置< /// <summary> /// 构造分页sql /// </summary> /// <param name="sql">sql分页前</param> /// <param name="orderColumn">排序列</param> /// <param name="rowIndex">开始位置</param> /// <param name="rowNum">页大小</param> /// <returns></returns> static public string buildFysql(string sql,string orderColumn,int rowIndex, int rowNum ) { StringBuilder sb = new StringBuilder(); sb.Append(" SELECT T1.* FROM ( SELECT ROW_NUMBER() OVER (ORDER BY T0. "); sb.Append(orderColumn); sb.Append(" ) AS [ROW_NUMBER], T0.* FROM ( "); sb.Append(sql);//29 AND 30 sb.Append(" ) AS T0 ) AS T1 WHERE T1.ROW_NUMBER BETWEEN ").Append(rowIndex ).Append(" AND ").Append(rowIndex+rowNum-1); return sb.ToString(); } 总结
以上是内存溢出为你收集整理的sqlserver 最优分页 源码全部内容,希望文章能够帮你解决sqlserver 最优分页 源码所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
评论列表(0条)