62,268
社区成员
发帖
与我相关
我的任务
分享
select top 3 * from
(
SELECT distinct(a.bm_id),COUNT(DISTINCT(user_id)) as usercount,bm_count,
((COUNT(DISTINCT(user_id)))*10000/bm_count) as per
FROM DoInfo AS p INNER JOIN BmInfo AS a ON a.bm_id=p.bm_id group by
a.bm_id ,a.bm_temp ,bm_count,user_id having a.bm_temp= 1 and user_id>0
) as t order by t.per desc;