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


a query to select maxmun 3 salaries of employee table

Answers were Sorted based on User's Feedback



a query to select maxmun 3 salaries of employee table..

Answer / tulasi

select * from (select * from emp order by sal desc) where
rownum<=3;

Is This Answer Correct ?    21 Yes 5 No

a query to select maxmun 3 salaries of employee table..

Answer / krishna kumar r

SELECT E1.ENAME,E1.SAL FROM EMP E1 WHERE 3>(SELECT COUNT(*)
FROM EMP E2 WHERE E2.SAL>E1.SAL ) ORDER BY SAL DESC

Is This Answer Correct ?    1 Yes 0 No

a query to select maxmun 3 salaries of employee table..

Answer / chaitanya

Select sal from emp order by desc fetch first 3 rows only;

Is This Answer Correct ?    1 Yes 0 No

a query to select maxmun 3 salaries of employee table..

Answer / munna

select * from emp e where &n=(select count(distinct sal)
from emp ee where e.sal<=ee.sal);

Is This Answer Correct ?    0 Yes 0 No

a query to select maxmun 3 salaries of employee table..

Answer / suresh babu

select * from employees a where 3 <= select count(distinct
b.salary) from employees b where a.salary >= b.salary);

This query,which returns the first maximum salary from
employees table.

Is This Answer Correct ?    0 Yes 0 No

a query to select maxmun 3 salaries of employee table..

Answer / dhanya

select rnk, no,sal from (
SELECT DENSE_rank()over(partition by no order by sal desc ) RNK,d2.no,sal FROM DUMMY2 d2)
where rnk =2;

Is This Answer Correct ?    0 Yes 0 No

a query to select maxmun 3 salaries of employee table..

Answer / kannan

select * from emp
where sal in (select max(sal) from emp
where level<=3
connect by prior sal>sal
group by level)

Is This Answer Correct ?    1 Yes 2 No

a query to select maxmun 3 salaries of employee table..

Answer / raju

select * from emp a where 3>=(select count(distinct(b.sal))
from emp b where b.sal>=a.sal )

Is This Answer Correct ?    4 Yes 6 No

a query to select maxmun 3 salaries of employee table..

Answer / elumalai.k

select top 3 salary from employee order by salary desc

Is This Answer Correct ?    5 Yes 7 No

a query to select maxmun 3 salaries of employee table..

Answer / ron

if you need to select by department then analytic function
is more readable:
1. use row_number() partition by dept order by sal desc as rn,
2. in where clause choose rn <4;

you can use rank() instead; if 2 or more employees have same
salary.

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More Oracle General Interview Questions

How to Remove the 3rd highest salary person record from table?

9 Answers   HCL, IBM,


Explain the importance of .pll extension in oracle?

0 Answers  


I have one table :EID,Depid,ename,sal I want to have max(sal) in each department.

5 Answers   Microsoft, Oracle, TCS,


I have a parent program and a child program. I want to write a statement in Exception Block of the parent program so that when the statement in the exception block is executed, the control goes to the next statement in the parent block bypassing the child block.How do i do that?

0 Answers   Mastek,


How do I use os authentication with weblogic jdriver for oracle and connection pools?

0 Answers  


What is a table index in oracle?

0 Answers  


How do you find out from the RMAN catalog if a particular archive log has been backed-up?

0 Answers  


Explain oracle 12c new features for developers?

0 Answers  


What is meant by joins?

0 Answers  


Display the order number and the number of months since the order was shipped for all orders that have been shipped in the last year (365 days). (Hint: Unshipped orders will have a null value).

1 Answers  


How to connect to a local oracle 10g xe server?

0 Answers  


What query tells you how much space a tablespace named test is taking up, and how much space is remaining?

0 Answers   Infosys,


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)