QUICK START:PatternsErrors & FixesSecurityBenchmarksDevOps RecipesCheatsheetsInterviewCompareTopicsHTMLCSSJavaScriptTypeScriptPythonSQLReactNext.jsNode.jsLinux & UbuntuKotlinSwiftC# / .NETJavaGoRustC++DSASystem DesignDevOpsCybersecurityAI / ML🎁 Cloud Perks & Tools β†’
SQLMedium

Find Second Highest Salary (SQL)

Write an SQL query to report the second highest salary from the Employee table. If there is no second highest salary, the query should report NULL.

Requirements:

  • Return the result table with a column named SecondHighestSalary.
  • Handle duplicate salaries appropriately.
Sample Input:
Employee: id, salary
Sample Output:
SecondHighestSalary: 200
sqlβ€’ Solution Editor
EXECUTION CONSOLE
Click β€œRun & Test Code” to execute your solution against test cases.