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 find the second highest salary from emp table?

Answers were Sorted based on User's Feedback



how to find the second highest salary from emp table?..

Answer / gaurav singh 'viccky'

select salary from user=(select max(salary)from user where
salary < (select max(salary)from user))

Is This Answer Correct ?    0 Yes 0 No

how to find the second highest salary from emp table?..

Answer / arjunraj

aa means table-alias name
bb means table-alisa name

select * from emp aa where 2=(select count(distinct empsalary) from emp bb where aa.empsalary<=bb.empsalary)

Is This Answer Correct ?    0 Yes 0 No

how to find the second highest salary from emp table?..

Answer / dakshin

select * from (select a.*,dense_rank() over (order by sal) rnk from emp a order by sal) where rnk =2

Is This Answer Correct ?    0 Yes 0 No

how to find the second highest salary from emp table?..

Answer / kishor dange

select max(sal) from table_name where sal<(select max(sal)
from table_name)

Is This Answer Correct ?    0 Yes 0 No

how to find the second highest salary from emp table?..

Answer / vikas

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

Is This Answer Correct ?    0 Yes 0 No

how to find the second highest salary from emp table?..

Answer / ashwini

select max(salary) from employee where salary < (select max(salary) from employee)

Is This Answer Correct ?    0 Yes 0 No

how to find the second highest salary from emp table?..

Answer / manjusha

select * from emp e1
where 2=(select count(distinct salary) from emp e2
where e1.sal<e2.sal);

Is This Answer Correct ?    0 Yes 0 No

how to find the second highest salary from emp table?..

Answer / hari thorat

select max(salary) from employee where salary <(select max(salary) from employee);

Is This Answer Correct ?    0 Yes 0 No

how to find the second highest salary from emp table?..

Answer / gunjal ghagre

Select sal from table_name order by sal desc limit 1,1;

Is This Answer Correct ?    0 Yes 0 No

how to find the second highest salary from emp table?..

Answer / debasish

select ename,sal from (select ename,sal,row_number()
over(order by sal desc)rn from emp)
where rn=1;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

how to create a database in oracle?please gve anser with example

1 Answers  


Explain the steps needed to create the scheduled job?

0 Answers  


what is data manipulation language? : Sql dba

0 Answers  


What is primary and foreign key?

0 Answers  


What are the two parts of a procedure ?

6 Answers   Hi Caliber IT,


Is sql microsoft?

0 Answers  


What is a behavioral trigger?

0 Answers  


What are the two types of cursors in pl sql?

0 Answers  


Can we create foreign key without primary key?

0 Answers  


How can we Get the Updated Rows? ie, There is 100s of Rows i updated the Rows who have salary 5000. then i want to select the Updated Rows. How can we achieve it?

4 Answers   Fidelity, KCP,


What is difference between TRUNCATE & DELETE?

16 Answers   Ahn Infotech, CitiGroup, ICICI, PreVator, Saama Tech, SkyTech, TCS,


Authentication mechanisms in Sql Server ?

1 Answers   BirlaSoft,


Categories