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?

Answers were Sorted based on User's Feedback



how to retrieve the top 2 salaried persons from a database?..

Answer / abc

Select salary from (select salary from employees order by
salary desc) where rownum <=2;

Is This Answer Correct ?    8 Yes 1 No

how to retrieve the top 2 salaried persons from a database?..

Answer / rajkumar

select top 1 colmn from table_name where colmn in
(select top 2 colmn from table_name where colmn is not
null order by colmn desc)

Is This Answer Correct ?    2 Yes 0 No

how to retrieve the top 2 salaried persons from a database?..

Answer / arun

select salary from(select salary from(select distinct salary from employees order by salary desc) where rownum<=2 order by salary) where rownum=1;

Is This Answer Correct ?    1 Yes 0 No

how to retrieve the top 2 salaried persons from a database?..

Answer / 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

how to retrieve the top 2 salaried persons from a database?..

Answer / mamta

Select sal
from salary_tbl
where rownum <= 2
order by sal desc;

Is This Answer Correct ?    0 Yes 0 No

how to retrieve the top 2 salaried persons from a database?..

Answer / anusreekr

An error is occuring saying "unknown column rownum".
Please let me know where rownum feature is available in all
the mysql versions.The server version i am using is 5.5.21.

Thanks

Is This Answer Correct ?    0 Yes 3 No

how to retrieve the top 2 salaried persons from a database?..

Answer / unknown

Select salary from (select salary from employees) where
rownum <=2;

Is This Answer Correct ?    1 Yes 7 No

Post New Answer

More SQL PLSQL Interview Questions

Can %notfound return null after a fetch?

0 Answers  


How to take user input in pl sql?

0 Answers  


What is the difference between Union and Union all. Which is faster.

0 Answers  


What is the Query to print out the individual total number of duplicate row in sql.

5 Answers   TCS,


What is blind sql injection?

0 Answers  


How to maintain the history of code changes of pl/sql?

3 Answers  


Difference between a query and strored procedure?

4 Answers   Microsoft,


What is trigger in pl sql with examples?

0 Answers  


Why you are not able to create a table using select command,if it is having a LONG column? for eg:create table test as select * from test1 here test1 containg a column having LONG datatype...

1 Answers  


What are the parameter modes supported by pl/sql?

0 Answers  


Can we insert in sql function?

0 Answers  


What is exit statement?

0 Answers  


Categories