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 database isolation in sql server? : sql server database administration

1049


What command is used to rename the database?

963


What is a user-defined function in the sql server and what is its advantage?

1058


Distinguish between nested subquery and correlated subquery?

996


What are views used for?

984


Explain the cursor lock types?

1001


What is difference between index seek vs. Index scan?

1106


Write a program using SQL queries to find a unique entry in a table.

956


how to take backup bcp out for a column in table in sql server?

2065


What are the steps to follow to configure SQL*Net?

1005


What is the library index called?

1022


What is user-defined function? Explain its types i.e. Scalar and inline table value user-defined function?

867


What is model database in sql server?

1018


What is ms sql server index?

1039


Do you know how to store and query spatial data?

1000