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

please tell me the query to get details of the employee
having the second largest salary

Answer Posted / roshan

select employeeid, employeeName ,Salary from table1 where
Salary =(select min(a.Salary) from table1 inner join
(select top 2 Salary from table1
order by Salary desc) a on table1.Salary = a.Salary)

if we change the top value we will get the n'th largest
salary

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What stored by the model?

1141


How to change the ownership of a schema in ms sql server?

1258


Explain full-text query in sql server?

1054


What are sub reports?

208


When would you use a before or after trigger?

957


How to call a function from a stored procedure in SQL Server ?

1087


What do you understand by a view?

1049


Explain insert into select statement?

1010


How many categories of functions based their return modes?

1152


What are the differences between substr and charindex in sql server.

1190


What is a Join and explain its types?

1153


Why are views required in the sql server or in any other database?

1004


How to start and end transact-sql statements?

1090


what is database replicaion? : Sql server database administration

1271


How to make a remote connection in a database?

1023