We study the following prescribed scalar curvature problem −Δu=K(y)u2∗−1,u>0inRN, where 2∗=N−22N. For N≥4, we construct a positive K(y) with maximum set {∣y∣=1} and critical order of flatness m=N−2 at ∣y∣=1, such that the equation admits only finitely many positive solutions in D1,2(RN). To this end, we prove the compactness of the solution set for this equation by blow-up analysis and then apply Sard's theorem to choose K for which each solution is non-degenerate and hence isolated, so that the solution set is finite. Our results also give a definite answer to Wei--Yan's conjecture in [J. Wei and S. Yan, JFA, 2010].