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 find the second highest salary from emp table?

Answer Posted / gokul

In MySQL, this query will be easier to find 2nd highest
salary and to fetch all the fields from a table.

select * from emp where sal not in (select max(sal)
from emp) order by sal desc limit 1

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we make an if statement within a select statement?

1010


How long does it take to learn pl sql?

1059


How to start oracle sql developer?

1032


Do stored procedures prevent sql injection?

966


how to start mysql server? : Sql dba

1195


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

931


What is a natural join?

1068


what are the security recommendations while using mysql? : Sql dba

1114


Advantages and disadvantages of stored procedure?

1120


What is multiple partition?

964


What does the argument [or replace] do?

1077


How do we accept inputs from user during runtime?

1060


How do I make my sql query run faster?

941


Is not null in sql?

990


What are the sql aggregate functions?

1122