I have a table called PORTFOLIOS in which I have PORTFOLIO_ID, PORTFOLIO_NAME and SCORING_RULE columns. The SCORING_RULE column can have two different values (like double_scoring or single_scoring).
Now the requirement is I have to see what is the percentage of each scoring rule by combining all the records.
when I select the bunch of records from the table by limiting it with ROWNUM condition the result set should reflect the those percentages.
For example in the above table I have total 20 records in which 40% of records have double_scoring and 60% records have single_scoring as SCORING_RULE. So when I select first 10 records with below query then the result set must contain 4 double_scoring and 6 single_scoring records. How to ensure this kind result set. The database is oracle 10g.
SELECT * FROM PORTFOLIOS WHERE ROWNUM <=10