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 is dense_rank?

879


How to pronounce postgresql?

1005


What is an exception in PL/SQL? What are the two types of exceptions?

1192


What is sql integrity?

1058


What is the purpose of my sql?

899


what is transaction? : Sql dba

958


Can a composite key be null?

909


How can you view the errors encountered in a trigger?

915


what is the difference between char and varchar data types? : Sql dba

999


What is sql exception?

912


what are the differences between procedure-oriented languages and object-oriented languages? : Sql dba

970


Compare sql & pl/sql

1045


Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10

2069


What is compound trigger?

958


What is write ahead logging in sql server?

987