mysql翻頁查詢重復,mysql分頁技術中用到的關鍵字?
mysql數據庫分頁用limit關鍵字,它后面跟兩個參數:startIndex和pageSize。如:請求第2頁,每頁10條數據,departmentId代表部門編碼,以科研部的員工為例,假設其部門編碼為1001Java code:
int cpage = 2;int pageSize = 10;int startIndex = (cpage-1)*pageSize;String sql = "select * from deployees from departmentid='1001' limit "+startIndex+","+pageSize;