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...


Write a query to find five highest salaries from EMP table.
(there is a column SALARY)

Answers were Sorted based on User's Feedback



Write a query to find five highest salaries from EMP table. (there is a column SALARY)..

Answer / k.prashanth

Select
ename,sal,deptno
from emp
where sal in
(select max
(sal) from emp
where
level<=5
connect by
prior sal<sal
group by level)

Is This Answer Correct ?    0 Yes 0 No

Write a query to find five highest salaries from EMP table. (there is a column SALARY)..

Answer / manoranjan sethy

Method 01:
---------
Select Ename, MAX (Sal) From Emp
Group by ROWNUM, Ename
Having Rownum <=5;

Is This Answer Correct ?    0 Yes 0 No

Write a query to find five highest salaries from EMP table. (there is a column SALARY)..

Answer / vivek dubey

this Query is wrong : " SELECT ENAME,SALARY FROM (SELECT ENAME,SAL FROM EMP ORDER BY SALARY DESC ) WHERE ROWNUM<6; " because We can not use Order by clause in SubQuery.

This Answer gives you the right data :

"
SELECT TOP 5
empsal.ENAME,
empsal.SAL
FROM
(
SELECT ENAME,SAL
FROM EMP
) AS empsal
ORDER BY empsal.SAL DESC
"

Is This Answer Correct ?    0 Yes 0 No

Write a query to find five highest salaries from EMP table. (there is a column SALARY)..

Answer / ajay dond

select salary from (select distinct salary from employees
order by salary desc)
where rownum<6

Is This Answer Correct ?    0 Yes 0 No

Write a query to find five highest salaries from EMP table. (there is a column SALARY)..

Answer / ram

select ename,salary from(select ename,salary from emp order by salary desc) where rownumber<6

Is This Answer Correct ?    0 Yes 0 No

Write a query to find five highest salaries from EMP table. (there is a column SALARY)..

Answer / kishore

select salery from (select salery from
emp order by salery desc) where rownum <=5 ;

Is This Answer Correct ?    2 Yes 3 No

Write a query to find five highest salaries from EMP table. (there is a column SALARY)..

Answer / manjunath u

select salary from(select salary from emp order by salary
desc)where rownum<=5;

Is This Answer Correct ?    0 Yes 1 No

Write a query to find five highest salaries from EMP table. (there is a column SALARY)..

Answer / alex, n.y [microsoft]

SELECT TOP 5 [SALARY] FROM [EMP]

Is This Answer Correct ?    3 Yes 4 No

Write a query to find five highest salaries from EMP table. (there is a column SALARY)..

Answer / kavitha nedigunta

select a.*
from(select empno,ename,sal
from emp
order by sal desc nulls last)a
where rownum <6
order by sal desc

Is This Answer Correct ?    3 Yes 5 No

Write a query to find five highest salaries from EMP table. (there is a column SALARY)..

Answer / mohammad murtuza ali

select * from emp as(empname,empsal,empdesc) where rownum<6

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More SQL PLSQL Interview Questions

When we can declare a column as Unique and Not Null both at the same time. What is the use pf Primary Key then?

2 Answers   Accenture, Unisoft Infotech,


there is A table and B table in A table there 5 rows and in b table there are 2 rows i am firing query select * from a,b what will be the output?

7 Answers   Cognizant,


Difference between inline query and stored procedure?

4 Answers   Bharat, Microsoft,


How do I run a program in pl sql?

0 Answers  


Why plvtab is considered as the easiest way to access the pl/sql table?

0 Answers  


What is the purpose of primary key?

0 Answers  


How to find only %th Highest Sal

6 Answers   Infogain, Symphony,


how to create temparary sequence

2 Answers   TCS,


Does SQL*Plus contains pl/sql Engine?

1 Answers   TCS,


Does view store data in sql?

0 Answers  


Can a varchar be a primary key?

0 Answers  


how to create a new view in mysql? : Sql dba

0 Answers  


Categories