select rank() over(partition by a.province order by dbms_random.value) ll,
a.lng,
a.lat,
c.ee
from crm_gd_lnglat a
left join (select province, round(5000 * temp / total) ee
from (select province, count(*) temp
from crm_gd_lnglat
where lng is not null
group by province) a,
(select count(*) total
from crm_gd_lnglat
where lng is not null) b) c on a.province =
c.province
where a.lng is not null
a.lng,
a.lat,
c.ee
from crm_gd_lnglat a
left join (select province, round(5000 * temp / total) ee
from (select province, count(*) temp
from crm_gd_lnglat
where lng is not null
group by province) a,
(select count(*) total
from crm_gd_lnglat
where lng is not null) b) c on a.province =
c.province
where a.lng is not null