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 are binary string data types in ms sql server?

1303


What is the sql server agent?

1096


How many databases Microsoft SQL server provides?

1097


What is schemabinding a view?

923


What is dbcc? Give few examples.

1043


How to delete an existing row with delete statements in ms sql server?

1100


What is the maximum row of a size?

1020


What is your recommendation for a query running very slow? : sql server database administration

1054


what is the primary use of the model database? : Sql server administration

1054


How to execute a sql statement using mssql_query()?

1056


What is change data capture (cdc) in sql server 2008?

1030


What is difference between inner join and join?

1048


Are there any preferred steps that need to be taken care of before starting the installation of sql server 2000?

994


What are indexes in sql?

1288


If a stored procedure is taking a table data type, how it looks?

6453