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 get employee name from employee table which is the
fiveth highest salary of the table

Answers were Sorted based on User's Feedback



How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / a g srikanth

Dear Shiv Shankar
There is a small mistake in your query

Select Salary From Employee a Where 5=(
Select Count(Distinct Salary) From Employee b
Where a.Salary <= b.Salary )

the correct one should be

Select Salary From Employee a Where 5=(
Select Count(Distinct Salary) From Employee b
Where a.Salary >= b.Salary )

please check it...

Is This Answer Correct ?    1 Yes 0 No

How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / praveen

SELECT TOP 1 salary
FROM
(
select TOP 5 salary
FROM
employee
ORDER BY
salary DESC
) A
ORDER BY
salary

Is This Answer Correct ?    1 Yes 0 No

How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / raghuvir

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

Is This Answer Correct ?    1 Yes 0 No

How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / ramu

select employee_name,salary from employee order by salary desc limit 1 offset 4;

Is This Answer Correct ?    1 Yes 0 No

How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / vijay

select min(salary) from (select rownum r,e.* from employees e order by salary desc) where rownum<=5;

Is This Answer Correct ?    0 Yes 0 No

How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / mrunali

select name from (select e.*, dense_rank() over (order by salary desc nulls last)as rn from emp e) where rn=5

Is This Answer Correct ?    0 Yes 0 No

How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / raju t.t

select firt_name, salary from employees a where 5=(select
count(distinct salary from employees b where a.salary
<=b.salary);

Is This Answer Correct ?    6 Yes 7 No

How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / anil alpati

SELECT employee_name FROM employee order by salary desc limit 1 offset 5 ;

Is This Answer Correct ?    0 Yes 1 No

How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / anil alpati

Select empsal From emp order by empsal desc offset 5 limit 1;

Is This Answer Correct ?    0 Yes 3 No

How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / shivashanker

Anybody knows the answer

Is This Answer Correct ?    1 Yes 6 No

Post New Answer

More SQL PLSQL Interview Questions

how to include numeric values in sql statements? : Sql dba

0 Answers  


What are different clauses used in sql?

0 Answers  


I want to display the employees who have joined in last two months. (It should be executed randomly means If I execute the query in March it should display Jan and Feb joined employees. Same query if i execute in Feb, 2007 it should display dec, 2006 and jan 2007 joined employees.

15 Answers   Wipro,


what is data integrity? : Sql dba

0 Answers  


State some properties of relational databases?

0 Answers  


What is the maximum number of triggers,can apply to a single table?

2 Answers  


cursor types? explain with example programs?

1 Answers   HP,


Can you sum a count in sql?

0 Answers  


What is TABLE SPACE?

4 Answers   ABB, TCS,


What is natural join in sql?

0 Answers  


What is the purpose of the sql select top clause?

0 Answers  


how to retrieve last tree records from table? select *from emp where rownum > (select count(*)-3 from emp); i am using this query to get last three records from table but its not giving any output, so please tell me what is the error in this query.

16 Answers  


Categories