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

Find 2nd Highest salery in emp table

Select* from emp where &n=
select * count from emp where (salery >=emp.salery)


Enter n value 2


These query is correct or not. Tell me any other methods.

Answer Posted / lince

select top 1 * from (select distinct top 2 * from emp order by sal desc)t order by sal asc

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is federation member?

116


What is Sqlpaging in SqlServer 2005 ?

1115


What is proper subset of candidate key?

1041


Explain filtered indexes?

1041


How do I start sql server 2016?

952


Can we use trigger new in before insert?

962


How do I find the query plan in sql server?

1015


How to insert data into an existing table?

1027


Explain differentiate between a having clause and a where clause?

949


What are the advantages of user defined function?

1042


Can the query output be sorted by multiple columns in ms sql server?

1028


What is @@error in sql?

1108


What is the difference between count () and rowcount ()?

1077


What is a full text index?

965


What stored by the model?

1139