Think php如何实现 sql子查询的count(*)!

浏览:3368 发布日期:2014/06/08 分类:求助交流
select count(*) from (
SELECT user.*,randTable5.user_name as belong_name,randTable121.user_name as invit_name
FROM `user` LEFT JOIN user randTable5
on user.belong_user_id=randTable5.user_id
LEFT JOIN user randTable121
on user.invit_user_id=randTable121.user_id
WHERE ( user.is_deleted = '0' ) HAVING invit_name='陈小宝'
) as temp;

像上面这个sql语句。think php代码如何实现?
@thinkphp
最佳答案
评论( 相关
后面还有条评论,点击查看>>