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 retrieve the top 2 salaried persons from a database?

Answer Posted / srinivas

select * from emp m
where
(select count(distinct sal)+1 from emp s
where s.sal>m.sal)<=2
order by sal desc

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the difference between myisam static and myisam dynamic? : Sql dba

1115


Which sql statement is used to return only different values?

1057


What are the disadvantages of file system?

1364


What is data manipulation language?

1234


What is the clause we need to add in function body to return variable?

1055


what is 'mysqladmin' in mysql? : Sql dba

1076


What is set serveroutput on?

1184


How to return multiple rows from the stored procedure?

1016


how do you tune the slow running queries in oracle db , explain the methodology

3235


What is the difference between inner join and natural join?

1059


Does google use sql?

1008


what is rollback? : Sql dba

1181


Define the select into statement.

1112


How do you declare a variable in pl sql?

1071


Can we create a trigger on view?

946