sql语句转为thinkphp子查询类型

浏览:1536 发布日期:2014/08/04 分类:求助交流 关键字: thinkphp 子查询 sql
原语句:$db->query('SELECT c.* ,
                        (SELECT COUNT(*) FROM city c2 WHERE c2.parent = c.id) as child_count
                        FROM city c WHERE c.parent='.$parent);
请问如何转为thinkphp的子查询等?
最佳答案
评论( 相关
后面还有条评论,点击查看>>