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. ...
-
DELETE FROM employee e WHERE e.emp_id NOT IN ( SELECT MIN(emp_id) FROM employee GROUP BY name, email ); 💡 Explanation: This qu...
-
Basic Level What is PL/SQL, and how does it differ from SQL? Answer: PL/SQL (Procedural Language/Structured Query Language) extends SQ...
No comments:
Post a Comment