1. 程式人生 > >mysql jfinal Db.paginate 提示Unknown column 'rownum' in 'field list'的問題

mysql jfinal Db.paginate 提示Unknown column 'rownum' in 'field list'的問題

mysql 沒有oracle的rownum,

使用如下分頁方式即可。

String selectSql = "SELECT * FROM (SELECT @rowno:[email protected]+1 as rownum,ID,name,sex FROM user,(select @rowno:=0) t) as temp";

page=Db.paginateByFullSql(1, 50, "select count(*) from user", selectSql);