select `check` from zz_subsidy where id=t1.sub_id 在这限制不好吗
解决方案 »
- 我想学习桌面用C++写的客户端和网页中用PHP写的程序之间通信的原理和知识,请知道的进来指点一下
- php获取ip的常用方法都是什么意思?
- 请教一个MYSQL的修改语句。。
- html和php混合代码怎么注释?
- 大家进来看我的URL重写
- Apache+PHP+MySQL配置问题,我已经按文档配置完成了,可还是不行。求救!
- 系统中安装了oralce,启动APACHE时出错,帮忙啊, the requested operation has failed,怎么解决
- 全部可用分都给你们了~求php论坛源码
- 急!急! header函数?
- 新手请教用户认证问题。
- 如何通过PHP把execl中的数据导入到MySql数据库里面去,在又从Mysql的数据库里把数据导出到Excel中? 急求!!!
- 泛型,可访问性不一致问题,请高手帮忙
最后改成这样试试P.S 是不是应该考虑优化一下数据库结构了,为了读一个字段就要连一个表,这个语句跑起来效率也是个问题
已经解决 ,标准方法
1.
select * from (
select t1.stu_id, t1.class,name, t1.per_check, t1.pen_id, t1.loan_id, t1.sch_id, t1.sti_id, t1.sub_id, (select `check` from zz_penury where id=t1.pen_id ) as pen_check, (select `check` from zz_loan where id=t1.loan_id ) as loan_check, (select `check` from zz_scholarship where id=t1.sch_id ) as sch_check, (select `check` from zz_stipend where id=t1.sti_id ) as sti_check, (select `check` from zz_subsidy where id=t1.sub_id ) as sub_check, t1.id from zz_student as t1 order by stu_id desc limit 0,30) a
where sub_check=2 2.
select t1.stu_id, t1.class,name, t1.per_check, t1.pen_id, t1.loan_id, t1.sch_id, t1.sti_id, t1.sub_id, (select `check` from zz_penury where id=t1.pen_id ) as pen_check, (select `check` from zz_loan where id=t1.loan_id ) as loan_check, (select `check` from zz_scholarship where id=t1.sch_id ) as sch_check, (select `check` from zz_stipend where id=t1.sti_id ) as sti_check, (select `check` from zz_subsidy where id=t1.sub_id ) as sub_check, t1.id from zz_student as t1
where exists (select `check` from zz_subsidy where id=t1.sub_id and `check`=2 )
order by stu_id desc limit 0,30 .