How to Select second Maximum salary in a Table ?
Answers were Sorted based on User's Feedback
Answer / guest
select max(sal) from Table
where sal not in(select max(sal) from Table);
Is This Answer Correct ? | 20 Yes | 3 No |
Answer / tanuj tewari
select max(sal) from table_name where sal<(select max(sal)
from table_name);
Is This Answer Correct ? | 15 Yes | 3 No |
Answer / abhijit
select max(sal) from table_name where
sal<(select max(sal) from table_name);
or
select sal from(select sal,dense_rank() over(order by sal
desc)
as rnk from table_name) where rnk=2;
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / ranjini
select max(salary) from employee not exists (select
max(salary)from employee)
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / arpit sachan
select min(Emp_Sal)from Employee_Test where Emp_sal in(select distinct top(2) Emp_Sal from Employee_Test order by Emp_Sal desc)
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / ranjith
select salary from table order by salaray desc limit 1,1
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / kuldeep singh
select max(sal) from emp where sal not in (select top2 sal from emp order by sal desc)
Is This Answer Correct ? | 1 Yes | 3 No |
Answer / sephali
select sal, rownum
from (select sal from table
order by sal desc)
where rownum=2
Is This Answer Correct ? | 0 Yes | 2 No |
How to use attributes of the implicit cursor in oracle?
How to use fetch statement in a loop?
How to manage transaction isolation level?
How index is implemented in oracle database?
What is SQL Tuning Advisor in Oracle?
how to hide the stored procedure inside a package
i have procedure p1.and also i declare the same procedure in a package. whice one is efficient package procedure or procedure?
what is the exact diiference between DBMS and RDBMS
How to insert a new row into a table in oracle?
Display those managers salary greater than the average salary of his employees?(Based on oracle standard Emp table)
1) What is ONE_SIZE_FITS_ALL approach? 2) Explain the Common & Variable Header of DATA FILE? 3) What are the Drawbacks to using OMF DB? and the Advantages? 4) List out the Advantages of Undo T.spaces over the Undo SEGMENT? 5) Difference between the Temporary tablespace with TEMPFILE and the Tablespace with TEMPORARY Keyword? 6) What are the situation extents are freeing for reuse.
how can we store any pdf file in oracle