select the 3rd maximum salary from sql server database if 4
(just an example In practically I may not know the exact
situation) of the highest salaries are equal.
Answer Posted / sumesh.s.g
--Sumesh.S.G--
SELECT TOP 1 salary
FROM (select top 3 Salary
from dbo.TBL_Employee
order by Salary desc) as TemTable order by Salary asc
--Happy coding--
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is user-defined multi-statement table-valued function?
What is a file group?
Difference between Inner vs outer joins?
How to fetch the next row from a cursor with a "fetch" statement?
What is the significance of null value and why should we avoid permitting null values?
How can windows applications connect to sql servers via odbc?
What is the difference between TRUNCATE and DROP?
What is a trigger in sql server?
What is spid in sql server profiler?
If you're given a raw data table, how would perform etl (extract, transform, load) with sql to obtain the data in a desired format?
What are the requirements on sql server network connections?
What are the recovery models in sql server 2000?
how to control the amount of free space in your index pages? : Sql server database administration
What is a functions and types in sql server?
Which are ddl commands?