|
本帖最后由 jiangj 于 2015-12-24 17:24 编辑
动态报表排序问题:
sql中已经写了order by ,但是页面出来的数据不是按这个字段排序的,
我写的sql是:
select a.member_name,c.real_name,b.phone,a.recharge_id,a.is_effect,a.money,a.time ,a.type from tjtyy_member_recharge a,tjtyy_member b , tjtyy_member_real_info c
where a.is_effect = 1 and a.member_id = b.id and a.member_id = c.member_id order by a.time desc
跟踪代码到封装sql,得到的sql是:
select * from ( SELECT t.* FROM ( select a.member_name,c.real_name,b.phone,a.recharge_id,a.is_effect,a.money,a.time ,a.type from tjtyy_member_recharge a,tjtyy_member b , tjtyy_member_real_info c
where a.is_effect = 1 and a.member_id = b.id and a.member_id = c.member_id order by a.time desc ) t ) sel_tab00 limit 0,20
在数据库中执行封装得到的sql就不是按时间倒序排的,请问这个怎么解决?
|
|