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 / velmurugan p

Select min(sal) from table_name where sal in(Select top 2 sal from table_name)

Is This Answer Correct ?    0 Yes 0 No

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

Answer / karthik.k

select max(salary) as second_highest from emp where salary
< (select max(salary) from emp)

Is This Answer Correct ?    0 Yes 0 No

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

Answer / pramod sharma

select f_name max(salary)from emp,dep
where salary<(select max(salary)from emp)

Is This Answer Correct ?    0 Yes 0 No

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

Answer / satish kumar

Select Top1 salary
from(select Distinct Top2 salary from employee order by salary DESC) a order by salary

Is This Answer Correct ?    0 Yes 0 No

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

Answer / rajkumar

SELECT * FROM TABLE WHERE columnName =
(SELECT MAX(column_name) FROM TABLE WHERE
column_name<(SELECT max(column_name) FROM TABLE))

Is This Answer Correct ?    0 Yes 0 No

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

Answer / mangesh pardhi

SELECT salary
FROM employee e
WHERE 2=(SELECT COUNT(DISTINCT salary)
FROM employees
WHERE e.salary<=salary)
--replace the number with 2,3,4 u wil find the that position
salary

Is This Answer Correct ?    0 Yes 0 No

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

Answer / kishan singh chilwal

SELECT MAX(sal)
FROM emp
WHERE sal <> (SELECT MAX(sal) FROM emp);

<> = not equal to
the SELECT statement in the WHERE clause will find the 1st max sal in the table
the 1st SELECT statement will find max sal in the table after excluding the first max sal

(ALTERNATE WAY)

SELECT MAX(sal)
FROM emp
WHERE sal not in (select max(sal) from emp );

Is This Answer Correct ?    0 Yes 0 No

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

Answer / syed hussain

select min(salary) from tbl_emp where salary in
(select top 4 salary from Tbl_emp order by salary desc)

Is This Answer Correct ?    0 Yes 0 No

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

Answer / hima

select sal from emp order by salary desc limit 1,1

Is This Answer Correct ?    0 Yes 0 No

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

Answer / subahar

SELECT MAX(average) AS Expr1
FROM sp
WHERE (average NOT IN
(SELECT MAX(average) AS Expr1
FROM sp AS sp_1))

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

What is a cursor for loop ?

4 Answers  


can i create trigger on synonym is it possible or not please help me

4 Answers   CGI,


What are different types of triggers?

0 Answers  


how to create object in plsql

2 Answers   TCS,


Are stored procedures faster than dynamic sql?

0 Answers  


how will u find statistics of a database objects?

2 Answers   iFlex,


HP Interview -2016 Unix 1) grep command in unix 2) what is set command

1 Answers   HCL,


what is meant by nl2br()? : Sql dba

0 Answers  


I have a CURSOR then why we need BULK COLLECT again?

1 Answers  


How well can multiple sessions access the same data simultaneously ?

1 Answers   Oracle,


Display the total debit counts, total credit counts, sum of total debits, sum of total credits from an employee's transaction table (a single table) containing the following columns. Transaction_number Transaction_amount Transaction_date Transaction_type --> tells if the amount is a credit or a debit. As the query alone is important, the table is left with specifying just the field's name. Pls help me with this query.

3 Answers   iNautix, Oracle,


What is the difference between subquery and correlated query?

0 Answers  


Categories