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

select top 3 sal from each dept?

Answer Posted / chiru

select *
from (select row_number() over(partition by deptno order by sal desc) r,
b.*
from (select rownum num, a.* from emp a order by sal desc) b)
where r <= 3

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is sqlite thread safe?

1061


Can we rename a column in the output of sql query?

1005


Which is better join or inner query?

1066


Write a sql query to find the names of employees that begin with ‘a’?

1025


Can variables be used in sql statements?

1045


what are the differences between require and include, include_once and require_once? : Sql dba

1033


How can we find duplicate records in a table?

956


what is 'mysqld'? : Sql dba

980


Explain aggregate functions are available there in sql?

1017


Difference between table function and pipelined function?

1030


What is difference between mysql and postgresql?

1168


Is it possible to include an insert statement on the same table to which the trigger is assigned?

1025


Explain isolation levels. : Transact sql

1079


What are the advantages of stored procedure?

1010


Can we create clustered index without primary key?

973