How to get second highest salary from a table
Answers were Sorted based on User's Feedback
Answer / senthil
select max(sal) from emp where sal <(select max(sal) from emp)
Is This Answer Correct ? | 13 Yes | 1 No |
Answer / srinivas
select * from emp m where(select count(distinct sal)+1 from emp s where s.sal>m.sal)=2
Is This Answer Correct ? | 7 Yes | 3 No |
Answer / saiz
select min(salary)
from emp
where salary in ( select top 2 salary
from emp
order by salary desc);
Is This Answer Correct ? | 3 Yes | 0 No |
Write a sql to print only character form the below string. @So&*CIE%$TE@GEN!@RAL
I have one table and column is c1 pk, c2 not null,c3 not null and 200 row in it and i add c4 column and value, how can is possible
How many parts of a pl sql block are optional?
How do I run a sql query?
How many postgresql users are there, worldwide?
How would you hide a table in sql. ie the table can be only visible to its maker?
What is sql integrity?
What is difference between pls_integer and integer?
What programs use sql?
write a query to delete similar records in same table
What does count (*) mean?
Its possible to add more than one primary key for the table