prss.net
当前位置:首页 >> 在thinkphp中想用not in和子查询组合一个sql,这个... >>

在thinkphp中想用not in和子查询组合一个sql,这个...

直接上代码 [php] view plain copy $product_info = M('product_info as info'); [php] view plain copy $productinfo = $product_info->join('left join c_price_comment as comment on info.sku=comment.sku')->where($where)->order('info.cr...

你测试一下,把SQL打印出来,我理解的意思是: select * from (select id,name from tablename group by field) as a where $where order by id status desc ; 只是我对平常子查询的写法,不了解TP是不是这样写的,但他们最后也是转化为这样的SQ...

网站首页 | 网站地图
All rights reserved Powered by www.prss.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com