临时表、分组查询

有数据表 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
 

 
临时表、分组查询

 

临时表、分组查询 

你可能感兴趣的:(临时表)