Second Top Employee as of the Start of Employment
List all employees who were 2nd top paid in the entire company as of the time their employment started
- Use a single SELECT statement only.
- At the time of employment start the rank of the employee by salary should be 2.
- Show the top salary at the time when the employee started with the company.
- We assume that no employees have ever been terminated since day 1.
- 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.