Select count(idx) from cs_part where part_index=1 and part_display_check=1 and idx<= order by part_ranking asc, idx asc