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 out the second highest salary?

Answers were Sorted based on User's Feedback



find out the second highest salary?..

Answer / shiv prakash

select salary from(select rownum as r,salary from(select
rownum,salary from emp order by salary
desc))where r=2;

Is This Answer Correct ?    20 Yes 18 No

find out the second highest salary?..

Answer / annada

SELECT e.lastname,e.salary FROM employees e
WHERE 1=(SELECT count(*) FROM employess s
WHERE s.salary>e.salary


that will return 2nd highest salry .if we place insted of 1
as 2 then we can get 3 rd highest salary .

Is This Answer Correct ?    3 Yes 1 No

find out the second highest salary?..

Answer / chaitanya pathak

select max(salary) from employee
whrere salary<(selsect max(salary) from employee)

Is This Answer Correct ?    2 Yes 0 No

find out the second highest salary?..

Answer / sandeep

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

Is This Answer Correct ?    2 Yes 0 No

find out the second highest salary?..

Answer / anitha

select min(salary)
from (select distinct salary
from employee
order by salary desc)
where rownum <= 2

Is This Answer Correct ?    2 Yes 0 No

find out the second highest salary?..

Answer / radhiv kumar

PROC SQL;
SELECT MAX(SALARY) FROM RIGHTMER1
WHERE SALARY < SELECT MAX (SALARY)FROM RIGHTMER1;
QUIT;

Is This Answer Correct ?    2 Yes 1 No

find out the second highest salary?..

Answer / naveen

selec * from emp e1 (n-1)=(select count(distinct(sal) from
emp e2 where e1.sal<=e2.sal))

Is This Answer Correct ?    1 Yes 0 No

find out the second highest salary?..

Answer / raghu

second highest salary department wise query would be this

select e.dept_id,e.salary,e.emp_name,e.rank from (select
dept_id,emp_name,salary,dense_rank() over (partition by
dept_id order by salary desc nulls last) rank
from employee)e
where e.rank = 2

Is This Answer Correct ?    1 Yes 0 No

find out the second highest salary?..

Answer / thananjayan

SELECT * FROM 'emp` WHERE salary < ( SELECT max( salary
)FROM emp ) ORDER BY salary DESC LIMIT 1

This is Mysql syntax, if you use Oracle just remove LIMIT 1
and put it ROWNUM=1;

Is This Answer Correct ?    1 Yes 0 No

find out the second highest salary?..

Answer / ishrat ali

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

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Oracle General Interview Questions

If a table column has is UNIQUE and has NOT NULL, is it equivalent to a PRIMARY KEY column?

8 Answers   IBM,


What are the Characteristics of Data Files ?

3 Answers  


Can you assign multiple query result rows to a variable?

0 Answers  


16. Display the order number, order line number and the shipping date. If the shipping date is null, display the string <not shipped yet>.

1 Answers   Wipro,


What is proxy method?

0 Answers  


What are the limitations of check constraint?

0 Answers  


What is a read only transaction in oracle?

0 Answers  


How to write date and time interval literals in oracle?

0 Answers  


How to change program global area (pga) in oracle?

0 Answers  


What are ACID properties in databases?

1 Answers  


9)When information has to be stored w.r.t employees and their respective departments, which of the following is the Correct formulation of entries? A)Employee and department would together be represented as an entity. B)This is too less information to decide on entities. C)An employee would be one entity and a department would be another. D)Such a scenario cannot be modelled in RDBMS

2 Answers   Mind Tree,


in account table account type amount ac1 credit 300 ac2 debit 5000 ac3 credit 3000 ac1 debit 4000 ac3 debit 2000 ac2 credit 4000 write a query how to get sum of credit & sum of debit

3 Answers   Polaris,


Categories
  • Oracle General Interview Questions Oracle General (1803)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)