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 name query output columns in oracle?
How to use windows user to connect to the server?
State and explain the different types of data models?
select trunc(round(156.00,-1),-1) from dual;
Do you know about aggregate functions? What is row num function? Can it be used all databases?
1 Answers Bravura Solutions, Cap Gemini,
23. Display the client name for all clients who have placed an order where any order line has more than 3 items. Do not use a table join anywhere in your query.
How would you go about verifying the network name that the local_listener is currently using?
Table Has C1 And C2 Column If Exits any record in c1 then Update c2 record Otherwise insert new record in the C1 And C2 (Using Procedure)
Give the Types of modules in a form?
What is the implicit cursor in oracle?
Display the order number and the number of months since the order was shipped for all orders that have been shipped in the last year (365 days). (Hint: Unshipped orders will have a null value).
Explain what are the advantages of views?