字符串直接转集合:
Arrays.asList(customerSiteId)
排名前十,其中用到百分比精确的方式:
select ztatble.siteName newName,ztatble.siteId,in_sum countSum,convert(IFNULL(intable.in_sum,0)/ztatble.count_sum,decimal(6,4)) newValues from
(select `name` siteName,customer_site_id siteId,count(*) count_sum from v_status_check_request_statistics
where task_type_id = 0 and check_status in(1,2)
and request_time BETWEEN '1527782400000' and '1528789211000'
and customer_id = 'FOSHAN_2018_FAKE'
group by customer_site_id) as ztatble left join
(select `name` siteName,customer_site_id siteId,count(*) in_sum from v_status_check_request_statistics
where task_type_id = 0 and check_status= 2
and request_time BETWEEN '1527782400000' and '1528789211000'
and customer_id = 'ANLITAI_2017_FAKE'
group by customer_site_id) as intable on ztatble.siteId = intable.siteId
order by newValues desc,countSum desc limit 10;