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 a second highest salary from a table?
Note:Suppose salaries are in duplicate values
eg:
Name Sal
Malli 60000
Pandi 60000
Rudra 45000
Ravi 45000

Answer Posted / praveenpinfo

Suppose table name is EMP.

SQL> Select distinct sal from emp e1 where 2=(select
count(distinct sal) from emp e2 where e1.sal<=e2.sal);

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to convert numeric values to character strings? : Sql dba

1035


What is difference between stored procedure and trigger?

1058


Can we use pl sql in mysql?

960


What is sql profiling in oracle?

995


How can we solve sql error: ora-00904: invalid identifier?

1164


Does normalization improve performance?

980


What is the basic form of sql query?

880


What is sql injection owasp?

999


What's the difference between a primary key and a clustered index?

946


What is the use of desc in sql?

914


What are the types pl/sql code blocks?

1067


Explain the insert into statements in sql?

936


discuss about myisam key cache. : Sql dba

974


What are the usages of sql?

1011


Mention what plvcmt and plvrb does in pl/sql?

1061