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 the most restrictive isolation level? : Transact sql

1028


What is partition in sql query?

950


how many values can the set function of mysql take? : Sql dba

935


how many groups of data types? : Sql dba

974


What is java sql drivermanager?

1023


What are the types of triggers in sql?

1018


What is the difference among union, minus and intersect?

950


How many types of privileges are available in sql?

1286


what is dbms? : Sql dba

934


How many subqueries can be nested in a statement?

935


What is the importance of sqlcode and sqlerrm?

1280


How exception handling is done in advance pl/sql?

920


What are the advantages of pl sql?

1074


What is user in sql?

970


Does google use sql?

914