表member 字段 userid usertuijian
要查询谁推荐的人数大于50的怎么查询啊?
------解决方案--------------------
试试这个
select * from member a where exists
(
select 1 from (select max(userid), usertuijian
from member group by usertuijian having count(*)>50)b where a.userid=b.userid
)