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...

Write a query to find second highest salary of an employee.

Answer Posted / humayun quaiser

slect max(sal) from emp
where sal not in (select max(sal) from emp);

or

select max(sal) from emp
where sal<(select max(sal) from emp);

or

select distinct sal from emp e
where 1=(select count(distinct sal) from emp
where sal>e.sal);

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is data manipulation language? : Sql dba

1027


Advantages and disadvantages of stored procedure?

1130


what is a relationship and what are they? : Sql dba

1113


What are different categories of sql commands?

1141


What is the life of an sql statement?

1034


Why plvtab is considered as the easiest way to access the pl/sql table?

1227


What is a field in a database?

1073


how to load data files into tables with 'mysqlimport'? : Sql dba

1104


how to write date and time literals? : Sql dba

974


Is keyword pl sql?

1012


Difference between truncate, delete and drop commands?

1092


explain about mysql and its features. : Sql dba

1021


Explain the purpose of %type and %rowtype data types?

942


how would you enter characters as hex numbers? : Sql dba

995


What is the maximum database size for sql express?

1039