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 get second highest salary in SQL(as/4000

Answers were Sorted based on User's Feedback



how to get second highest salary in SQL(as/4000..

Answer / siva kumar yachamaneni

select max(salary) from Employee where salary<(SELECT
max(salary) from Employee)

Is This Answer Correct ?    0 Yes 1 No

how to get second highest salary in SQL(as/4000..

Answer / prabir

Select * From employee emp1 Where 2 = (Select
Count(Distinct(emp1.salary)) From employee emp2 Where
emp2.salary > emp1.salary)

Is This Answer Correct ?    3 Yes 5 No

how to get second highest salary in SQL(as/4000..

Answer / shasi

select sal from emp a where &n=(select count(sal) from emp
b where a.sal>=b.sal)
First u enter 1 means 1st highest sal.then enter2 2nd
highest sal

Is This Answer Correct ?    1 Yes 3 No

how to get second highest salary in SQL(as/4000..

Answer / ashish raut

for 2nd highest price..............

SELECT max(Price) as [MaxPrice] from OrderDetails
where Price<(SELECT max(Price)as MaxPrice from OrderDetails)

for 3rd highest Price........

SELECT max(Price) as [MaxPrice] from OrderDetails
where Price<(SELECT max(Price)as MaxPrice from OrderDetails
where price<(SELECT max(Price)as MaxPrice from OrderDetails))

Is This Answer Correct ?    0 Yes 2 No

how to get second highest salary in SQL(as/4000..

Answer / praveen

select * from emp where max(sal)
where rownow=2

Is This Answer Correct ?    0 Yes 2 No

how to get second highest salary in SQL(as/4000..

Answer / apurva

Select *
From (
Select *
From (select * from emp order by sal desc)
Where rownum < 3 order by sal) ---> n+1 for example for
secound you should use 3
Where rownum < 2

Is This Answer Correct ?    4 Yes 7 No

how to get second highest salary in SQL(as/4000..

Answer / sachin bhalsinge

select * from (select salary from employees order by salary
desc)where rownum=2;

Is This Answer Correct ?    5 Yes 11 No

how to get second highest salary in SQL(as/4000..

Answer / ramesh.p

Select salary
From ( Select salary from emp order by salary desc)
Where rownum =2;

Is This Answer Correct ?    10 Yes 19 No

how to get second highest salary in SQL(as/4000..

Answer / siddhartha

select sal, ename from employee where ROWNUM = 2 order by
sal;

Is This Answer Correct ?    12 Yes 36 No

Post New Answer

More SQL PLSQL Interview Questions

What is a trigger ?

11 Answers   Accenture, BirlaSoft,


Which sql statement is used to return only different values?

0 Answers  


mail-id table contains two columns(email_id,userid) it contains different types of mail-ids,and no of users. here username length is differ na,(ex- tamil@yahoo.com,joshua@hotmail.com like) now i want to fetch the email-ids only starting from '@' (ex-@gmail.com,@yahoo.com,@hotmail.com

5 Answers  


How is data stored on a disk?

0 Answers  


What do you mean by stored procedures? How do we use it?

0 Answers  


how to delete duplicate rows from a specified table(only single table) how do you know which join is need to be used

11 Answers   UST,


wt is the diff b/w greast and max ,least and min? wt is the diff b/w case and decod?

4 Answers   Oracle, TCS, Tecnics,


what is explain plan?, given an example...

3 Answers   Polaris,


How can I get the number of records affected by a stored procedure?

0 Answers  


How do I view tables in sql developer?

0 Answers  


What is the difference between drop and truncate commands?

0 Answers  


What does pl sql developer do?

0 Answers  


Categories