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...


find the third highest salary?

Answers were Sorted based on User's Feedback



find the third highest salary?..

Answer / anu

select *
FROM (select emp1.* ,rownum rnum
     from ( select *  from emp order by sal_amount desc ) emp1
     where rownum<=3) 
where rnum >=3   

Is This Answer Correct ?    1 Yes 0 No

find the third highest salary?..

Answer / farrukh shaikh

select vu.sal from
(select DENSE_RANK() over(order by sal desc) as sr,
sal from emp) vu
where vu.sr=3

Is This Answer Correct ?    3 Yes 3 No

find the third highest salary?..

Answer / meher

SELECT SAL FROM EMP A WHERE &N= (SELECT COUNT(DISTINCT) SAL
FROM EMP B WHERE A.SAL<B.SAL)

--Pass the value for N as 2 to get 3rd highest salary.
--pass 0 for highest sal,1 for 2nd highest,2 for 3rd
highest and so on....

Is This Answer Correct ?    6 Yes 6 No

find the third highest salary?..

Answer / pradeep

select * from emp where sal in(select min(sal) from (select
sal from emp order by sal
desc) where rownum <= 3);

Is This Answer Correct ?    3 Yes 3 No

find the third highest salary?..

Answer / gautam

select * from (
SELECT ROWNUM as RANK, ename, sal
FROM (SELECT ename,sal FROM emp ORDER BY sal DESC)
WHERE ROWNUM <= 3)
where rank=3

Is This Answer Correct ?    1 Yes 1 No

find the third highest salary?..

Answer / deepak kumar

SELECT sal FROM empORDER BY sal DESC LIMIT 2 , 1

Is This Answer Correct ?    0 Yes 0 No

find the third highest salary?..

Answer / yankee

select * from (select * from <table_name> order by salary
desc)where rownum<4

---this way u can get the record of the top 3 salaries and
easily filter out the 3rd positioned salary from there.

Is This Answer Correct ?    4 Yes 5 No

find the third highest salary?..

Answer / mousumi dalai

select min(sal) from emp where sal in
( select sal from
(select sal from emp order by sal desc)
where rownum<=3)

Is This Answer Correct ?    0 Yes 1 No

find the third highest salary?..

Answer / anil pednekar

select * from (select sal from table1 group by sal ) where
row num=3

Is This Answer Correct ?    1 Yes 2 No

find the third highest salary?..

Answer / satish prajapati

select min(sal) from (select
sal from emp order by sal
desc) where rownum <= 3

Is This Answer Correct ?    2 Yes 4 No

Post New Answer

More SQL PLSQL Interview Questions

How many developers work on postgresql?

0 Answers  


If we have n no of columns in a table, can we add new column in that table with not null constraint?

2 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  


What is partition in sql query?

0 Answers  


List the different type of joins?

0 Answers  


7. Where would you look for errors from the database design?

1 Answers   Fintellix,


What are different types of joins ?

5 Answers   BirlaSoft,


What is equi join in sql?

0 Answers  


Write the order of precedence for validation of a column in a table ?

2 Answers  


What is delimiter in pl sql?

0 Answers  


Why truncate is faster than delete?

0 Answers  


Give me some examples of predefined exceptions.

3 Answers  


Categories