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 / vinod

SELECT MAX(SAL) FROM TEST_123 WHERE SAL NOT IN (SELECT
MAX(SAL) FROM TEST_123)

Is This Answer Correct ?    0 Yes 0 No

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

Answer / udayalakshmij

select emp_name,max(salary) from emp except(select max(salary) from emp);

Is This Answer Correct ?    0 Yes 0 No

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

Answer / amarendra swain

select max(sal) from employee
where sal not in (select max(sal) from employee )

Is This Answer Correct ?    0 Yes 0 No

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

Answer / shankar panda

SELECT DISTINCT(E.SALARY) FROM EMPLOYEES E WHERE 2=(SELECT COUNT(DISTINCT D.SALARY) FROM EMPLOYEE D WHERE D.SALARY >= E.SALARY)

Is This Answer Correct ?    0 Yes 0 No

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

Answer / sreenadh reddy

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

Is This Answer Correct ?    0 Yes 0 No

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

Answer / bharath konegadde

Select Emp_Name from emp_table where Id=(Select Emp_Id from Salary Order By salary Desc limit 0,1)

Is This Answer Correct ?    0 Yes 0 No

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

Answer / chiguru&

SELECT MAX(SALARY) FROM EMPLOYEE WHERE SALARY NOT IN
(SELECT MAX(SALARY) FROM EMPLOYEE)

Is This Answer Correct ?    0 Yes 0 No

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

Answer / mohan rathour

select max(e1.salary) from Emp_table e1 where e1.salary not
in (select max(e2.salary) from Emp_table e2 )

Is This Answer Correct ?    0 Yes 0 No

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

Answer / harish

select * from emp where 2=(select count(distinct sal) from emp s where s.sal>e.sal

Is This Answer Correct ?    1 Yes 1 No

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

Answer / manikishore

select * from emp e where
2 =(select count(distinct sal) from emp where e.sal<=sal);


//if you want to retrieve 3rd max(sal) then you can use 3 in place of 2,,,like that for so on..

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More SQL PLSQL Interview Questions

How can you select unique records from a table?

0 Answers  


How many types of privileges are available in sql?

0 Answers  


Is sql a dbms?

0 Answers  


how to use 'mysql' to run sql statements? : Sql dba

0 Answers  


What are the advantages of VIEW?

5 Answers  


i have 2 table table one 4 columns respective values a1 7,a2 6,a3 8 ,a4 12 & table two 4 colums respective values a1 7,a2 6,a3 8,a4 15.if table one & table two 3 colums same then 4th column values 1)Qes diff >5 then print 5 * diff value 2)Que diff <5 print 5

1 Answers  


Can we use update in sql function?

0 Answers  


What are the two characteristics of a primary key?

0 Answers  


In a table only one column how to update rows

5 Answers   Microsoft,


What is the difference between between and in condition operators?

0 Answers  


how to enter numeric values as hex numbers? : Sql dba

0 Answers  


What are tuples in sql?

0 Answers  


Categories