Accepted Solution Second Highest Salary


  • 0
    S

    select Salary
    from (
    select distinct Salary
    from Employee
    order by Salary desc
    limit 1,1
    ) p
    UNION ALL
    SELECT NULL
    limit 1;


  • 0
    S

    what about this:
    SELECT (SELECT DISTINCT A.Salary
    FROM Employee A
    ORDER BY A.Salary DESC LIMIT 1,
    1) Salary
    FROM dual;


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.