Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


how to check the 3rd max salary from an employee table?

Answers were Sorted based on User's Feedback



how to check the 3rd max salary from an employee table?..

Answer / somanath

select sal from emp a where 3=(select
count(distinct(sal)) from emp b
where a.sal<=b.sal)

Is This Answer Correct ?    34 Yes 7 No

how to check the 3rd max salary from an employee table?..

Answer / radha sri seshu.kolla

1)SELECT MAX(SAL) FROM EMP WHERE LEVEL=3 CONNECT BY PRIOR
SAL>SAL
2)SELECT E.SAL FROM
(SELECT SAL,DENSE_RANK() OVER(ORDER BY SAL DESC)R FROM EMP)
E WHERE E.R=3

9966112520

Is This Answer Correct ?    10 Yes 5 No

how to check the 3rd max salary from an employee table?..

Answer / b.v.siva kumar

Use this for SQL Server:

select top 1 salary from emp where salary in (select
distinct top 3 salary from emp order by salary desc) order
by salary

Is This Answer Correct ?    5 Yes 0 No

how to check the 3rd max salary from an employee table?..

Answer / venkateswarulu.s

select min(salary) from emp where salary in(select distinct
top 3 salary from
emp order by salary desc)

Is This Answer Correct ?    13 Yes 10 No

how to check the 3rd max salary from an employee table?..

Answer / gourvendra singh

In oracle you can find the 3rd max salary with the help of
the command:-

select sal from(select sal from(select distinct sal from
emp order by sal desc)
where rownum <=3 order by sal asc) where rownum=1;

Is This Answer Correct ?    7 Yes 4 No

how to check the 3rd max salary from an employee table?..

Answer / ar

select c.emp_id,c.salary from (select rownum as
rn1,c.emp_id,c.salary from (select * from table_name ORDER
by salary DESC) b) c
where c.rn1 = n --(n=3)

Is This Answer Correct ?    2 Yes 0 No

how to check the 3rd max salary from an employee table?..

Answer / amit

select max(sal) from emp where sal<(select max(sal) from emp where sal<(select max(sal) from emp));

Is This Answer Correct ?    2 Yes 0 No

how to check the 3rd max salary from an employee table?..

Answer / danny

SELECT min( sal )
FROM emp
WHERE sal
IN (

SELECT DISTINCT sal
FROM emp
ORDER BY sal DESC
LIMIT 0 , 3
)

Is This Answer Correct ?    2 Yes 0 No

how to check the 3rd max salary from an employee table?..

Answer / neeraj79

SELECT DISTINCT salary
FROM employee
ORDER BY salary DESC
LIMIT(2,1)

Is This Answer Correct ?    2 Yes 0 No

how to check the 3rd max salary from an employee table?..

Answer / arjun

select min(sal) from (select sal from (select distinct(sal)
from emp order by sal desc) where rownum<4)

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More SQL PLSQL Interview Questions

Which tcp/ip port does sql server run?

0 Answers  


Does indexing improve query performance?

1 Answers  


What is the need of merge statement?

0 Answers  


What do you understand by pl/sql packages?

0 Answers  


Why are aggregate functions called so?

0 Answers  


Hi All, I am new to both this blog and technology. I was able to see a response for one of the questions on triggers as below. I would like to know why are we using " if rtrim(to_char(sysdate,'day'))=rtrim('sunday') then" instead, can't we use " if sysdate = 'sunday' then". I can understand the use of "rtrim", but dont know y v r using to_char. I have seen this in many cases but did not get a convincible explaination. Please help me with this and do excuse if this question sounds silly. Thanks in advance...... create or replace trigger trg_sun before insert on <table name> begin if rtrim(to_char(sysdate,'day'))=rtrim('sunday') then raise_application_error(-20345,'no transaction in sunday'); end if; end trg_sun;

2 Answers  


Is sqlite thread safe?

0 Answers  


what is difference between stored procedures and application procedures,stored function and application function?

1 Answers  


What is the difference between syntax error and runtime error?

0 Answers  


difference between oracle 8i and oracle 9i

8 Answers  


What is sql*loader?

0 Answers  


I need a exceptoin in pl/sql block so that if any errors occur in the block then no exception should errors should raise?

1 Answers  


Categories