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 n'th highest salary from emp ?

Answers were Sorted based on User's Feedback



how to find the n'th highest salary from emp ?..

Answer / brajesh kumar

SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT
(DISTINCT (b.sal)) FROM EMP B WHERE a.sal<=b.sal);

Is This Answer Correct ?    15 Yes 8 No

how to find the n'th highest salary from emp ?..

Answer / venki

SELECT LEVEL,MAX(SAL) FROM EMP WHERE LEVEL=&LEVEL
CONNECT BY PRIOR SAL>SAL GROUP BY LEVEL;

Is This Answer Correct ?    1 Yes 0 No

how to find the n'th highest salary from emp ?..

Answer / madhu

to get nth higest value

SELECT EMP_NAME,EMP_SALARY
FROM EMP_TABLE
ORDER BY EMP_SALARY DESC
LIMIT n-1, 1

this is for mysql server

Is This Answer Correct ?    1 Yes 1 No

how to find the n'th highest salary from emp ?..

Answer / ramaniranjan das

select top1 * from (select distinct top nth from table name
by column name ) alisa name of table order by column name

Example:-Create table tab_employee
(
Emp_id int,
Emp_name varchar(50),
Emp_salary money,
Emp_deg varchar(30),
emp_add varchar(100)
);
INSERT INTO tab_employee
VALUES ('1001','ANIL','18000','MANAGER','hyd')
Go
INSERT INTO tab_employee
VALUES ('1002','AKIL','6000','CLERK','Mub')
Go
INSERT INTO tab_employee
VALUES ('1003','VINOD','7000','SALESMAN','Bang' )
GO
INSERT INTO tab_employee
VALUES ('1004','VIKAS','8000','SALESMAN','BBSR' )
GO
INSERT INTO tab_employee
VALUES ('1005','SUNIL','15000','MANAGER','Orissa' )

select top 1 * from tab_employee where Emp_salary not in
(Select Distinct top 3 Emp_salary from tab_employee order
by Emp_salary Desc)order by Emp_salary Desc

Is This Answer Correct ?    0 Yes 0 No

how to find the n'th highest salary from emp ?..

Answer / bharath

select e1.* from emp e1
where &n=
(select count(distinct(*))
from emp e2
where e2.sal>e1.sal);

Is This Answer Correct ?    0 Yes 0 No

how to find the n'th highest salary from emp ?..

Answer / nusrath sultana

select * from emp
where &n=(select count(distinct(sal)) from emp b
where emp.sal<b.sal)

Is This Answer Correct ?    0 Yes 1 No

how to find the n'th highest salary from emp ?..

Answer / jaya u

SELECT A.EMPNAME ,A.SAL FROM EMP A
WHERE A.SAL = (SELECT DISTINCT (b.sal)
FROM EMP B WHERE ROWNUM = &N
ORDER BY B.SAL DESC );

Is This Answer Correct ?    0 Yes 5 No

how to find the n'th highest salary from emp ?..

Answer / sunil panghal

select max(salary) from employees

Is This Answer Correct ?    1 Yes 16 No

how to find the n'th highest salary from emp ?..

Answer / sunil panghal

select salary from emp where salary=(select max(salary)
from emp)

Is This Answer Correct ?    6 Yes 23 No

how to find the n'th highest salary from emp ?..

Answer / brajesh kumar

SELECT *FROM EMP WHERE SAL=(SELECT MAX(SAL) FROM EMP)

Is This Answer Correct ?    5 Yes 25 No

Post New Answer

More Oracle General Interview Questions

What do you mean by merge in oracle and how can you merge two tables?

0 Answers  


Can we connect to ORACLE db using Windows Authentication?

0 Answers   MCN Solutions,


what is the use of rank function?

1 Answers  


What is TNS File

7 Answers   Thermotech,


Where are the settings stored for each instance in oracle?

0 Answers  


Explain the use of grant option in imp command.

0 Answers  


How to make a Data Backup in oracle ? What is the procedure for creating the dump files in oracle ( any version ) ?

3 Answers   Satyam,


What are the components of Physical database structure of Oracle Database?

4 Answers  


What is transaction control statement and how many types of transaction control statement in Oracle?

0 Answers   MCN Solutions,


What is oracle sid?

0 Answers  


How to check database size in Oracle?

0 Answers   MCN Solutions,


Display those managers salary greater than the average salary of his employees?(Based on oracle standard Emp table)

6 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1809)
  • 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)