有数据表 ts_invite_record ,内容如下:
select count(*) as count from ( (SELECT distinct uid FROM ts_invite_record ) as tempTableName)
select uid, count(fid) AS count from ts_invite_record GROUP BY uid ORDER BY count DESC limit 0,2
有数据表 ts_invite_record ,内容如下:
select count(*) as count from ( (SELECT distinct uid FROM ts_invite_record ) as tempTableName)
select uid, count(fid) AS count from ts_invite_record GROUP BY uid ORDER BY count DESC limit 0,2