1:mysql通用查詢sql /* * sql:能夠是單表的查詢語句,也能夠是多表的聯合查詢語句 * firstIndex:其實的索引 * pageSize:每頁顯示的記錄數 */ select o.* from (sql) o limit firstIndex,pageSize
2:sqlserver通用查詢sqlmysql
/* * firstIndex:起始索引 * pageSize:每頁顯示的數量 * orderColumn:排序的字段名 * sql:能夠是簡單的單表查詢語句,也能夠是複雜的多表聯合查詢語句 */ select top pageSize o.* from (select row_number() over(order by orderColumn) as rownumber,* from(sql) as o where rownumber>firstIndex;
3:oracle分頁sqlsql
/* * firstIndex:起始索引 * pageSize:每頁顯示的數量 * sql:能夠是簡單的單表查詢語句,也能夠是複雜的多表聯合查詢語句 */ select * from(select a.*,ROWNUM rn from(sql) a where ROWNUM<=(firstIndex+pageSize)) where rn>firstIndex