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 difference between rollback and rollback to statements?

1046


How do I tune a sql query?

957


How do I view a procedure in sql?

953


what is bdb (berkeleydb)? : Sql dba

1007


Why stored procedure is better than query?

922


Which is better varchar or nvarchar?

976


Can we rename a column in the output of sql query?

976


Do we need to create index on primary key?

903


How many columns should be in an index?

950


Write a sql select query that only returns each name only once from a table?

992


How to use sql*plus built-in timers?

1168


What does trigger mean in slang?

1032


What does sign mean sql?

1071


What is optimistic concurrency control? : Transact sql

969


Explain architecture of sql server notification services?

1035