主子表关联查询问题
金色海 发布于98月前 1答/3417阅

Sql: select * from eova_object where code = ?

Sql: select * from eova_field where object_code = ? order by order_num

Sql: select count(*) from sc_user_recharge where user_id like ?

Sql: select * from sc_user_recharge where user_id like ? limit 0, 10000

JFinal action report -------- 2016-03-28 16:29:52 ------------------------------

Controller  : com.eova.widget.grid.GridController.(GridController.java:1)

Method      : query

UrlPara     : tongjibaobiao

Interceptor : com.eova.interceptor.LoginInterceptor.(LoginInterceptor.java:1)

为什么查询子表数据的时候 用like呢?

现在的问题是当子表user_id为20的时候 主表ID 为2或者20 都会出现 子表的数据。


[沙发] Jieven
主子关联的字段必须为查找框或者下拉框,并且要写好对应表达式,否则就是模糊查询,请尝试后确认!
最佳
提交评论
嘿,我来帮你!