select e.program_id,p.pro_name,e.website_id,web.web_name,e.sina_weibo_id as weibo_id,mbl.sina_weibo_id as mbl_weibo_id ,count(*) as event_count,concat('sina') as weibo from event e left join program p on e.program_id=p.program_id left join website web on e.website_id=web.website_id left join member_black_list mbl on e.website_id=mbl.website_id and e.sina_weibo_id=mbl.sina_weibo_id where e.sina_weibo_id!="" and p.status=1001 and p.on_going=1 group by e.program_id,e.website_id,e.sina_weibo_id having event_count>1
union all select e.program_id,p.pro_name,e.website_id,web.web_name,e.tencent_weibo_id as weibo_id,mbl.tencent_weibo_id as mbl_weibo_id ,count(*) as event_count,concat('tencent') as weibo from event e left join program p on e.program_id=p.program_id left join website web on e.website_id=web.website_id left join member_black_list mbl on e.website_id=mbl.website_id and e.tencent_weibo_id=mbl.tencent_weibo_id where e.tencent_weibo_id!="" and p.status=1001 and p.on_going=1 group by e.program_id,e.website_id,e.tencent_weibo_id having event_count>1 order by event_count desc limit 3
|