JFinal中多表连接分页

dreamers 发布于 2013/05/17 15:42
阅读 531
收藏 0

请问一下,我下面这条语句为什么不能执行?

Db.paginate(1, LJYConstants.pageSize, "select b.* from ", " blog as b, tag as t, blogtagmap as btm where btm.tid = t.id and btm.bid = b.id and t.name = ?", tagName);

后台生成的SQL代码为:

select count(*)  blog as b, tag as t, blogtagmap as btm where btm.tid = t.id and btm.bid = b.id and t.name = ?

加载中
2
27号
27号

from 放错位置了。

应该是:

Db.paginate(1, LJYConstants.pageSize, "select b.* ", "from blog as b, tag as t, blogtagmap as btm where btm.tid = t.id and btm.bid = b.id and t.name = ?", tagName);

1
后天雨街
后天雨街
from写在后面就行
1
soloj
soloj
Db.paginate(1, LJYConstants.pageSize, "select b.* from ", " blog as b, tag as t, blogtagmap as btm where btm.tid = t.id and btm.bid = b.id and t.name = ?", tagName);

改成

Db.paginate(1, LJYConstants.pageSize, "select b.* ", " from blog as b, tag as t, blogtagmap as btm where btm.tid = t.id and btm.bid = b.id and t.name = ?", tagName);

返回顶部
顶部