临时表、分组查询

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

 

临时表、分组查询 

猜你喜欢

转载自huangqiqing123.iteye.com/blog/1661051