Top Salary Puzzle
Find highest salary in each department without using MAX function
- Use a single SELECT statement only.
- For an added complexity (optional): try not using ANY functions at all (neither group, nor analytic, not even scalar)
- Try to come up with 2-3 different solutions.
- You have about 1 week to solve the puzzle and submit your solution(s) but whoever does it sooner will earn more points.
- The scoring rules can be found here.
- Solutions must be submitted as comments to this blog post.
- Use <pre>or <code> html tags around your SQL code for better formatting and to avoid losing parts of your SQL.
A correct answer (and workarounds!) will be published here in about a week.
My Oracle Group on Facebook:
If you like this post, you may want to join my Oracle group on Facebook: https://www.facebook.com/groups/sqlpatterns/
Would you like to read about many more tricks and puzzles? For more tricks and cool techniques check my book “Oracle SQL Tricks and Workarounds” for instructions.