SELECT
MIN(SALARY)
FROM
EMP
WHERE
SALARY in (SELECT
DISTINCT TOP 2 SALARY
FROM
EMP
ORDER BY
SALARY DESC
)
;WITH T AS
(
SELECT *,
DENSE_RANK() OVER (ORDER BY Salary Desc) AS Rnk
FROM Employees
)
SELECT Name
FROM T
WHERE Rnk=2;
Subscribe to:
Post Comments (Atom)
SQL Interview Questions
Common SQL Interview Questions Common SQL Interview Questions 1. JOIN Types INNER JOIN: Only matching row...
-
What is PL/SQL Profiler? The PL/SQL Profiler is a diagnostic tool that helps you: Measure performance metrics for PL/SQL programs. ...
-
What Are Bind Variables? Bind variables are placeholders used in SQL statements that are replaced with actual values at runtime . They ...
-
DELETE FROM employee e WHERE e.emp_id NOT IN ( SELECT MIN(emp_id) FROM employee GROUP BY name, email ); 💡 Explanation: This qu...
No comments:
Post a Comment