thinkphp这个语句怎么写成连贯操作
select(casewhent1.cstm_nothent1.cstm_noelset22.cstm_noend)cstm_no,t1.inst,t1.cdm_bal,...
select (case when t1.cstm_no then t1.cstm_no else t22.cstm_no end) cstm_no,t1.inst,t1.cdm_bal,t1.fix_bal,t1.fin_bal,t1.fund_bal,t1.national_debt_bal,t1.insu_bal,t1.total_bal as jssum,t22.total_bal as cxsum from
(select * from inst_custom_assets where month='$begindate' and county='$county' and assets_lvl='$assets_lvl') t1 left JOIN inst_custom_assets t22 on t22.month ='$enddate' and t22.county='$county' and t22.cstm_no = t1.cstm_no 展开
(select * from inst_custom_assets where month='$begindate' and county='$county' and assets_lvl='$assets_lvl') t1 left JOIN inst_custom_assets t22 on t22.month ='$enddate' and t22.county='$county' and t22.cstm_no = t1.cstm_no 展开
推荐于2016-04-14
展开全部
$subQuery = $model->field('id,name')->table('tablename')->group('field')->where($where)->order('status')->select();
http://document.thinkphp.cn/manual_3_2.html#sub_query //可以 到里面去看下
http://document.thinkphp.cn/manual_3_2.html#sub_query //可以 到里面去看下
更多追问追答
追问
我这个语句不能直接作为子查询的语句吗
追答
可以 这样写记得把表名称写完整包括前缀,需要用个变量在sql语句前面接受数据
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2015-12-10
展开全部
where 和 array 看手册
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询