终于到数据库了...... partition by 暂时 先记录下... 以后在详解....
select * from (
select tpi.*,
row_number() over (partition by tpi.org_city order by tpi.org_city) rn
from t_product_index tpi
where tpi.org_city in (
select org_city from(
select count(1) ss,org_city from t_product_index where type = 0 group by org_city order by ss desc
) where rownum <10
) and tpi.type = 0
) where rn <= 8