select cl_type,app_version,count(app_version) as count_num from (select cl_type,app_version,cl_id from online.bl_hdfs_maidian_updates where partition_date >= "20200201" group by cl_type,app_version,cl_id) group by cl_type,app_version
select cl_type,app_version,count(app_version) as count_num from
( select *,rank() over(partition by cl_id order by partition_date desc) as ranking from
(select cl_type,app_version,cl_id,partition_date from online.bl_hdfs_maidian_updates where partition_date >= "20200201" group by cl_type,app_version,cl_id,partition_date)