sql中需要用到UNION,又要分页,用jfinal Db.paginate怎么做呢?

现在有个业务需要得到两个用户表的并集,并分页取出。

怎么用Db.paginate来实现呢?

SQL:

select a.name from user a union all select b.name from user b;

评论区

JFinal

2018-01-22 16:35

仍然是写好 sql 就行, just do it

Lemonnnn

2018-09-28 10:19

Db.paginate("select * ","from (select * from a union all select * from b) table",currpage,pageSize,param);

热门反馈

扫码入社