Skip to content
Advertisement

How to find out 2nd highest salary of employees?

Created table named geosalary with columns name, id, and salary:

I tried this below code to find 2nd highest salary:

However, getting this error message:

What’s wrong with my code?

Advertisement

Answer

I think the error message is pretty clear: your sub-select needs an alias.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement