Puzzle: All employees are sorted by employee number and need to be split in 3 groups equal in size (as close as possible). Employees with the smallest numbers will get into the 1st group, the 2nd group will have employees with the next (bigger) range of numbers, etc.
Write a single SELECT statement (against emp table) that would show group number, the range of employee numbers, and the size of each group.
Group RANGE Count ----- ---------- ---------- 1 7369-7654 5 2 7698-7844 5 3 7876-7934 4
To submit your answer (one or more!) please start following this blog and add a comment to this post.
A correct answer (and workarounds!) will be published here in a week.
If you like this post, you may want to join my new Oracle group on Facebook: https://www.facebook.com/groups/sqlpatterns/
For more tricks and cool techniques check my book “Oracle SQL Tricks and Workarounds” for instructions.