+ 6
Which query will you use to display details of employees having second maximum salary ?😇😇
Brain Teaser 😋
4 odpowiedzi
+ 14
I got it !
SELECT * FROM EMP WHERE SAL = (SELECT MAX(SAL) FROM EMP WHERE SAL< ( SELECT MAX(SAL) FROM EMP);
😋😋
+ 2
select *from emp order by sal desc limit 1,1;
+ 2
select * from emp where sal < (select sal from emp order by sal desc limit 1,1) ;
to select everyone whose salary is less than the second highest salary
+ 1
select top 1 * from emp where ID in (select top 2 ID from emp order by sal desc) order by sal
I think that would do it too..