SQL Part 2 Flashcards

(1 cards)

1
Q

find the second highest distinct salary from Employee(ID, Salary). If there is no second highest salary, return NULL

A

SELECT (SELECT DISTINCT salary FROM employee ORDER BY salary DESC LIMIT 1 OFFSET 1) AS SecondHighestSalary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly