select * from(
SELECT ny,prod_id,SALED_CNT,
 row_number()
 OVER (PARTITION BY ny
       ORDER BY SALED_CNT desc NULLS LAST) top_3
FROM table) b
where b.top_3<=3;