How would I be able to get N results for several groups inan oracle query.
For example, given the following table:
|--------+------------+------------|| emp_id | name | occupation ||--------+------------+------------|| 1 | John Smith | Accountant || 2 | Jane Doe | Engineer || 3 | Jack Black | Funnyman ||--------+------------+------------|
There are many more rows with more occupations. I would like to getthree employees (lets say) from each occupation.
Is there a way to do this without using a subquery?