Faced the problem of choosing the n th number of records. Let me explain: you need to select 10 rows for each result in the table. You can, of course, use Union , but the results are about 1000.
select * from t_1 x where x.result = '1' and rownum <= 10 union select * from t_1 x where x.result = '2' and rownum <= 10 union select * from t_1 x where x.result = '3' and rownum <= 10 union select * from t_1 x where x.result = '4' and rownum <= 10 Question how to write without Union? The Result field has about 1000 unique values.