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

if the salary is simple non-duplicate salary, you can use
the below queries:

select max(sal) from emp where sal != (select max(sal) from emp)

you can also try

select sal from (select * from emp order by sal desc) where
rownum = 2

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are expressions?

1011


What is a variable in sql?

1001


Can I learn sql in a week?

1059


Name the operator which is used in the query for pattern matching?

945


What is PL/SQL Records?

1185


How consistent is the view of the data between and within multiple sessions, transactions or statements ?

2218


how many ways we can we find the current date using mysql? : Sql dba

1099


What is lookup table in sql?

1045


What is difference between hql and sql?

1073


What is union and union all keyword in sql and what are their differences?

1100


What do you know by pl/sql cursors?

1102


What is the use of <> sql?

978


What is exception? What are the types of exceptions?

1073


What is sql basics?

1039


what is the syntax used for partition in tsql? : Transact sql

1014