查询汇总的sql

select   list.listname, list.createtime,listcount from dream_list as list ,   (select listid,count(listid) as listcount  from dream_list_user  group by listid  order by count(listid) desc)  as table1  where list.sysid=table1.listid and listcount>2  order by list.createtime desc ; 

你可能感兴趣的:(sql)