通用单表分页语句
这个可以写成存储过程,也可用于拼接语句,比较灵活
string sql = "Select " + colums + " FROM (select ROW_NUMBER() Over(order by " + sort + " ) as rowId, " + colums + " from " + table + " where " + where + " ) as tempTable where rowId > " + startSize + " and rowid < " + endSize;