Select Random Rows in PL/SQL
734514Nov 13 2009 — edited Dec 15 2009I would like to know if anyone has a suggestion fora select statement that would select random rows from a table based on the following:
The table contains 1-to-many categories. From each of these categories I need to select a 'x' amount of rows based upon the category id, with a total of 25 rows being selected overall. Some categories will have only 1 row selected, some will have more than 1. The rows selected contain questions that are either multiple choice (type=1) or true/false (type=2). The total rows selected (25) cannot contain more than 20% of true/false questions. Anyone have a solution for a select statement? Thanks.